Well, hello neighbor! A planet with some similarities to Earth has been discovered "only" 11 light-years (that's a mere 64 trillion miles) from our solar system, astronomers announced in a study published Wednesday. The new world is named Ross 128b (the star is known as Ross 128) and is now the second-closest planet yet detected that may have a surface temperature similar to Earth. Only the planet Proxima b, which orbits around the star Proxima Centauri, is closer, at 4.2 light-years away. The planet is also roughly the same size as Earth. An added bonus is that Ross 128b is also the closest planet yet discovered that orbits a rather quiet, inactive red dwarf star, which may increase the chances that this planet could potentially sustain life. That's because unlike other stars, such as Proxima Centauri, the star Ross 128 doesn't produce deadly ultraviolet flares and X-ray radiation. Red dwarfs are some of the coolest, faintest — and most common — stars in the universe. In fact, astronomers say this exoplanet may be the closest known comfortable abode for possible life. An exoplanet is any planet not in our solar system. Although it is currently 11 light-years from Earth, Ross 128 is moving towards us and is expected to become our nearest stellar neighbor in just 79,000 years. At that point, Ross 128b will take the crown from Proxima b and become the closest exoplanet to Earth. The new planet was discovered with the High Accuracy Radial velocity Planet Searcher (HARPS), which is located at an observatory in Chile. “This discovery is based on more than a decade of HARPS intensive monitoring," said Nicola Astudillo-Defru of the University of Geneva in Switzerland, who co-authored the study. "Only HARPS has demonstrated such a precision and it remains the best planet hunter of its kind, 15 years after it began operations,” he said. Astronomers are now detecting more and more of these temperate exoplanets, and the next stage will be to study their atmospheres, composition and chemistry in more detail, scientists said. So far, NASA's Exoplanet Archive has about 3,500 alien worlds, only a small fraction of which are potentially similar to Earth. The discovery was published in the journal Astronomy and Astrophysics.


Build Your Own Real Time Traffic Data Feed
Earlier someone asked me about if it is possible to build a real time traffic data feed straight from traffic cameras. This is my brief investigation. Also, this is the first time I ever do computer vision. Enjoy the adventure!
What is a Real Time Traffic Map?
On a high level, a real time traffic map is composed of two parts:
- A real time data feed of the vehicle speed of a road segment.
- A user interface presenting the information in 1) , which is usually a map like this below.
Inside the enclosed red rectangle, there are no green/yellow/red roads indicating traffic status. Outside of the rectangle, there’s green/yellow/red roads which indicate current traffic status.
This little city of Macau enclosed in the red rectangle is one of the unfortunate places on Earth where Google Maps do not offer real time traffic map as of this writing. The Macau government does not offer any real time traffic data feed. Without the traffic data feed, you cannot really do the traffic map.
So, how about we do something about the real time traffic data feed?
What does a Traffic Data Feed Look Like?
A real time traffic data feed generally gives you these information, and is updated periodically:
- Coordinates describing the start to the end of the road segment
- Average traffic speed or travel time for the road segment
- Current traffic speed or travel time for the road segment
So if the current traffic speed is a lot lower than the average traffic speed, you know it is having a traffic jam. If there is a major accident, the current traffic speed will probably drop to very low. The journey time data feed in UK does something similar. Bolded the interested areas below:
<elaboratedData id="GUID-1080026-10130"> <sourceInformation> <sourceCountry>gb</sourceCountry> <sourceIdentification>10130</sourceIdentification> <sourceName> <value lang="en">NTCC</value> </sourceName> </sourceInformation> <basicDataValue xsi:type="TravelTimeValue"> <time>2014-03-09T03:35:00Z</time> <affectedLocation> <locationContainedInGroup xsi:type="LocationByReference"> <predefinedLocationReference>Section10130</predefinedLocationReference> </locationContainedInGroup> </affectedLocation> <travelTime>287.0</travelTime> <freeFlowTravelTime>246.0</freeFlowTravelTime> <normallyExpectedTravelTime>262.0</normallyExpectedTravelTime> </basicDataValue> </elaboratedData>
What About Macau?
The Macau government does not offer any real-time API of the road traffic, however they do offer real time traffic cameras for some of the roads. The cameras are colored at a 352 x 288 resolution. It updates every 3 seconds. So, technically, it is an image sequence and not a video feed. You can simply write a script to pull image data off the cameras every 3 seconds.
How Do You Build a Traffic Feed From a Traffic Camera?
It is not an easy task to calculate the current traffic speed from a image sequence. However, we could try something that might yield potentially good results: counting the number of cars on the road. The intuition is that if there are many cars, the traffic is probably bad. If not, the traffic is probably good. Note that this varies from cameras to cameras, and also, traffic red lights could cause false positives. But let’s deal with those cameras that aim at the bridges like this one:
OpenCV library is an excellent starter for any generic computer vision tasks. I used the Python-OpenCV wrapper for it. We will use the Haar cascade classifier in OpenCV (see my earlier post of the idea) to perform the car detection, using this exported model cars3.xml as a quick starter which is already trained to detect cars in images.
Directly applying the the model onto our image gives this result:
For our first attempt, the detection on the top left seems to be just plain wrong, and we also the small van at the bottom-most. We can do better. Let’s tune our model parameters.
Better, the top left detection looks more reasonable. We can play with the model parameters to get more optimal results. But before that, we know that the sea, the black areas are probably useless, so let’s just crop them away during the car detection phase.
Directly applying car detection on the near roads gives a much better result!
With the car count, we can now build a model that tries to evaluate something like given 5 images in a road for the past 15 seconds, and the number of cars in each image, is it a 1) heavy traffic, 2) mid traffic, or 3) low traffic? This is future work which I will not go through here.
Things to Know Too!
This post is overly simplified! It is not that easy, really. For these reasons and many more:
- The models might perform well on daytime, but night time could be bad. Initial results suggest that the cars3.xml model performs poorer for night time car detection.
- The traffic camera might be not pointing perpendicular to the road, causing car detection to be less accurate.
- Red lights. Some of these cameras cover red lights. Red lights causes car counts to build up, but are they definitely a sign of poor traffic? It may not be.
- Occlusion. Cars overlapping might cause data to be skewed. We might want to train our model to handle this.
- cars3.xml model does not detect motorbikes at all.
Source Code and Run It Yourself
Here is the source code that runs through source images, which I included some sample images already. You will need OpenCV and Numpy, which you can download here (excellent link!) for Windows users. For linux users, just pip install it.
To run the script, just do this:
python detect_cars_in_image_seq.py
I also pasted the source code here for reference.
""" Author: Eric Chio <ckieric[at]gmail[dot]com> Date: 2014/03/08 Project: Macau Real Time Traffic Data Feed Website: / Idea: - Loads an image sequence - Crop the image to only areas of interest (no sea, just roads, and nearby roads) - Create a cascade classifier with cars3.xml - Use cascade classifier to detect cars, tune parameters accordingly. Note, cars3.xml do not detect motorbikes. """ import numpy as np import cv2 # Loads the data as a VideoCapture format, which is really just # an image sequence. image_sequence = 'Data/Camera3/image_%05d.jpg' cap = cv2.VideoCapture(image_sequence) # Load our cascade classifier from cars3.xml car_cascade = cv2.CascadeClassifier(r'cars3.xml') # Reduce frame number of tests. number_of_frames_to_load = 30 for frame_id in xrange(number_of_frames_to_load): ret, image = cap.read() # Crop so that only the roads remain, eliminates the distraction. image = image[120:,:-20] # Use Cascade Classifier to detect cars, may have to tune the # parameters for less false positives. cars = car_cascade.detectMultiScale(image, 1.008, 5) for (x,y,w,h) in cars: cv2.rectangle(image,(x,y),(x+w,y+h),(255,0,0),2) print 'Processing %d : cars detected : [%s]' % (frame_id, len(cars)) cv2.imshow('frame', image) cv2.waitKey(300) cap.release() cv2.destroyAllWindows()


RWS 100: Terms for Studying the Rhetoric of Written Arguments (Glossary Addenda)
Rhetoric refers to the study, uses, and effects of written, spoken and visual language.
Argument – any piece of written, spoken or visual language designed to bring about some change in a reader’s, listener’s or hearer’s ideas or attitudes. An argument asks us to consider, believe or do something. It is a conclusion or claim based on evidence.
In rhetoric, argument does not refer to a situation in which people are fighting. Rather, it refers to a situation in which people are making a case for a way of seeing things.
Components of argument include:
Claim –
Noun: A claim is an arguable assertion. It is a conclusion based on information or data.
Verb: To make a claim is to assert that something is the case.
Usually it is possible to identify a claim that is the central point or conclusion that an argument makes. A claim may appear at the beginning or end of a text, but it may appear at any point in an argument, or it may not appear explicitly anywhere in the argument, in which case the reader must infer it from the evidence in the text. Often arguments make more than one claim. They sometimes also make one or more sub-claims.
Reason (sometimes also called grounds or evidence or data)
A reason is evidence, data or information given to support a claim. To find reasons, ask why the claim can be made. What have you got to go on? What evidence is there to support this claim?
One good practice is to map or chart or annotate the kinds of work done by each paragraph or section or subsection of an argument.
Examples of language describing author’s projects
Metadiscourse is language about language. Often, metadiscourse announces what a paper will be about and what it will do. Metadiscourse can be used both to announce the overall project or purpose of the paper and to announce its argument.
Metadiscourse also provides signposts along the way, guiding the reader to what will come next and showing how that is connected to what has come before.
Examples from professional articles:
"In this essay, I examine in some detail what we mean by . . . My primary purpose, however, is to create a new, shared discourse for understanding X."
"I want to explore a connection between X & Y . . ., but as I will suggest. . ."
"My essay moves from an analysis of this problem to case studies of [people] wrestling with it. My argument is this: . . . . Such inquiry must start, as I will here, by confronting the conflicts within . . ."
"In what follows, I hope to complicate X by demonstrating the social potential of both Y and Z. I contend that. . . . I show how these attitudes emerge not only in response to A but to B."
"The following discussion sets out an analysis and an illustration. The analysis identifies how several claims cohere. . . . The illustration offers a formulation of what X could be today."
Student work on Chua: students can also use metadiscourse to describe their writing projects. For example:
This paper further investigates Chua’s argument by using additional sources about globalization in order to clarify both the problem and implications that she describes.
I begin with a brief description Amy Chua’s project and what it asks readers to consider. I then move to a discussion of additional resources that make her work more understandable.
To bring Chua’s argument about the “explosive collision” of these forces into sharper focus, I explore two additional sources. The first extends Chua’s argument, and the second complicates it by showing another way to look at problems that emerge with globalization.
Additional examples of metadiscourse in our course texts:
Chua, 113
The argument I am making is frequently misunderstood. I do not propose a universal theory. . . . The point, rather, is this:
Kaldor, 270
In this essay, I shall distinguish between the different types of armed forces that are emerging in the post-Col War world. . .
Scott, 522
I shall use the term public transcript as a shorthand way of describing the open interaction between subordinates and those who dominate.
Scott, 531
Now that the basic idea of public and hidden transcripts has been introduced, I will venture a few observations by way of orienting the subsequent discussion.
Ehrenreich, 196
But the real question is not how well I did at work but how well I did at life in general, which includes eating and having a place to stay. The fact that these are two separate questions needs to be underscored right away.
Ehrenreich, 204
But the resistance of employers only raises a second and ultimately more intractable question: Why isn’t this resistance met by more effective counterpressure from the workers themselves?
Examples of language describing authors’ arguments:
In Nickel and Dimed Ehrenreich argues that America is not truly a democracy, but rather a “culture of extreme inequality” (212), in which the unskilled work for less pay than it is possible to live on.
Ehrenreich argues against the assumption that poverty is simply a result of unemployment. Rather, her research shows that, for many employed people, poverty results from low ages.
In “A World on the Edge,” Amy Chua suggests that democracy, free market economies, and ethnic hatred are “the three most powerful forces operating in the world today” (108). As she investigates the relationship among these three forces, she makes a two-part argument, proposing both a problem and a solution. Challenging accepted notions about democracy and free markets, she argues that the spread of these often fuels ethnic hatreds.
Context: the larger textual and cultural environment in which specific rhetorical acts take place.
Here are some ways in which DRWS instructors may talk about the term context:
Publication data: where was a source published? What sort of publication is that? What is its readership? What are the interests/themes/methods of that publication? Does the source text provide any clues to the readership and their interests?
For example, Amy Chua’s “A World on the Edge” was originally published in the Wilson Quarterly, a journal that many students and instructors aren’t familiar with.
A quick Google search turns up this magazine’s website, which says, “By presenting the best writing and thinking of academics, specialists, and others to a broad audience, [the Wilson Quarterly] aims to overcome the specialization and information overload that prevent the public from following developments in significant realms of knowledge. The magazine ranges over many subject areas but always with an eye to public questions: issues in politics and policy, culture, religion, science, and other fields that bear upon our public life.”
This tells us that the article was written by a specialist, but for a lay audience interested in knowing about a range of topics. We could check the table of contexts of an issue of the magazine to get a better feel for what those topics are.
Author’s life: who wrote the work? Who is that person? When and where does/did that person live? What do we know about his/her other work, activities, methods, public appearances, reputation? Does the source text include any clues about the author’s life and works?
For example, Robert Coles, in “The Tradition: Fact and Fiction,” provides readers with several anecdotes about his practice as a psychologist and his experiences with other psychologists, authors, and documentarians, providing clues about his reputation and work.
For example, Ronne Hartfield, in her introduction to Another Way Home: The Tangled Roots of Race in One Chicago Family, positions her book in relation to contemporary work on mulattoness, naming five recent books that address this topic in ways that are different from her own approach (page xiv).
Sometimes writers refer to past work which may be an important antecedent for their arguments. The source text may include references to or clues about this past work. For example, Martin Luther King in “Letter from a Birmingham Jail” refers to Socrates and Ghandi as sources of ideas about non-violent protest.
Rhetorical acts address audiences and respond to particular events or situations. Sometimes these audiences are quite specific. For example, Martin Luther King, in his “Letter from a Birmingham Jail,” addresses a specific audience of clergy about the lunch counter protests that were happening in Birmingham.
Mark Hertsgaard, in “The Oblivious Empire,” responds to the events of 9/11 and the question “why do they hate us”?
How did people respond to the work when it was published? Was it well received? Were people shocked?
For example, the reception of Martin Luther King’s “Declaration of Independence from the War in Vietnam” was hostile in some circles, with people calling King a traitor.
For example, in “Appearances,” John Berger begins his argument concerning the meaning of photographs by addressing how most viewers are used to experiencing photography in certain ways.
For example, looking at James Agee and Walker Evans’ Let Us Now Praise Famous Men, readers may be able to read the images of white Depression-era migrants differently when seen in the context of the current political climate concerning the felonization of immigration.
Context: a useful discussion by rhetoricians Faigley and Selzer:
In Good Reasons: Designing and Writing Effective Arguments (Longman 2006), Lester Faigley and Jack Selzer describe textual and contextual analysis, two approaches to rhetorical analysis that roughly correspond to RWS 100 and 200:
[G]enerally approaches to rhetorical analysis can be placed between two broad extremes—not mutually exclusive categories but extremes along a continuum. At the one end of the continuum are analyses that concentrate more on texts than contexts. They typically use rhetorical concepts to analyze the features of texts. Let’s call this approach textual analysis. At the other extreme are approaches that emphasize context over text. These emphasize reconstructing the cultural environment . . . that existed when a particular rhetorical event took place, and then depend on that re-creation to produce clues about the persuasive tactics and appeals. Those who undertake contextual analysis—as we’ll call this second approach—regard particular rhetorical acts as parts of larger communicative chains, or “conversations” (63)
They add:
[C]ontextual rhetorical analysis always proceeds from a description of the rhetorical situation that motivated the item in question. . . . It regards communications as anything but self-contained:
Rhetorical analysis from a contextualist perspective understands individual pieces as parts of ongoing conversations.
The challenge is to reconstruct the conversation surrounding a specific piece of writing of speaking (69-70).


Machine Learning and Optimization Seminar
The Machine Learning and Optimization is a student-led seminar in the Department of Mathematical Sciences at NJIT. Its goal is to expose the participants to topics in machine learning and optimization by:
- Facilitating hands-on workshops and group discussions to explore and gain experience
- Inviting speakers to introduce machine learning and optimization concepts (both established and under development)
Spring 2023
Workshops
- 2/16/23: Transformer neural networks (DALLE, ChatGPT, etc.) - David Mazowiecki
- 3/16/23: Inverse problems for acoustics - Diego Rios
Presentations
- 2/9/23: Generative adversarial networks - Soheil Saghafi
- 2/23/23: A deep learning approach to infer connectivity and neuronal dynamics from spike trains - Rodrigo Pena (NJIT)
Past Presentations
Fall 2022
Workshops
- 9/15/22: Python set up, machine learning basics, gradient descent, and automatic differentiation - Connor Robertson
- 10/6/22: Neural networks - structure, building, and training - Jake Brusca
- 10/13/22: Data-driven model discovery - Connor Robertson
- 10/20/22: Convolutional neural networks - Soheil Saghafi
- 11/3/22: Recurrent neural networks - Austin Juhl
- 11/10/22: Recurrent neural networks for beat prediction - Prianka Bose
- 12/1/22: Reinforcement learning - Sepideh Nikookar
Spring 2022
- Wasserstein GANs Work Because They Fail - Axel Turnquist
- Mean-field Theory: Drift and the Mean Drift - Binan Gu
Fall 2021
- Computing the Distance Between Probability Measures - Axel Turnquist
- Full Waveform Inversion Using the Wasserstein Metric - Brittany Hamfeldt
- Image Sharpening - Axel Turnquist
- Neural Networks for function approximation and data-driven modeling - Connor Robertson
- Optimal control of systems governed by PDEs with uncertainty - Georg Stadler
- Stochastic Temporal Networks - Binan Gu
- Topological Data Analysis Applied to Interaction Networks in Particulate Systems - Lou Kondic
Spring 2021
Fall 2020
- Why does stochastic gradient descent work so well? - Axel Turnquist
- Information Geometry & Learning - Axel Turnquist
- Graph-based Learning Beyond the Paradigm of Neural Networks - Binan Gu
- Effective Dimension in High-Dimensional Problems - Axel Turnquist
- Bayesian Statistics and Machine Learning - Gan Luan
- Matrix Completion and Sparse Recovery - Axel Turnquist
- Wasserstein GAN - Yixuan Sun
- Graphical Model Selection - Binan Gu
- Learning Frameworks - Axel Turnquist


import numpy as np
import math
from project.set_up_calculation import site_from_input_file, load_site_data
from project.grid import index_of_grid_at_x, phi_at_x, energy_at_x
from project.constants import boltzmann_eV
from bisect import bisect_left
[docs]class Set_of_Sites:
""" The Set_of_Sites object groups together all of the Site objects into one object and contains functions for the calculations that provide properties of all of the sites together rather than individually. """
def __init__( self, sites ):
self.sites = sites
def __add__( self, other ):
""" Allows the concatenation of multiple Set_of_Sites objects"""
if type( other ) is not Set_of_Sites:
raise TypeError
return Set_of_Sites( self.sites + other.sites )
def __getitem__( self, index ):
""" Returns the site corresponding to a given index """
return self.sites[ index ]
def __iter__( self ):
"""
Iterator over self.sites
"""
return iter( self.sites )
[docs] def subset( self, label ):
""" Returns a list of all the sites which contain a particular defect """
return [ s for s in self.sites if s.label == label ]
[docs] def get_coords( self, label ):
""" Returns a list of the x coordinates for all the sites wich contain a particular defect """
return [ s.x for s in self.sites if s.label == label ]
[docs] def calculate_energies_on_grid( self, grid, phi ):
"""
Returns an array of energies at their points on a one-dimensional grid.
Args:
grid (object): Grid object - contains properties of the grid including the x coordinates and the volumes. Used to access the x coordinates.
phi (array): electrostatic potential on a one-dimensional grid.
Returns:
energies_on_grid (array): energies at their grid points
"""
energies_on_grid = np.zeros_like( grid )
for site in self.sites:
energies_on_grid[index_of_grid_at_x( grid.x, site.x )] =+ energy_at_x( site.defect_energies, grid.x, site.x )
return energies_on_grid
[docs] def calculate_probabilities( self, grid, phi, temp ):
"""
Calculates the probability of a site being occupied by its corresponding defect.
Args:
grid (object): Grid object - contains properties of the grid including the x coordinates and the volumes. Used to access the x coordinates.
phi (array): electrostatic potential on a one-dimensional grid.
temp (float): Absolute temperature.
Returns:
probability (array): probabilities of defects occupying each site using their grid points
"""
probability = np.zeros_like( grid.x )
for site in self.sites:
probability[index_of_grid_at_x( grid.x, site.x )] = np.asarray( site.probabilities( phi_at_x( phi, grid.x, site.x ), temp ) )
return probability
[docs] def calculate_defect_density( self, grid, phi, temp ):
"""
Calculates the defect density at each site.
Args:
grid (object): Grid object - contains properties of the grid including the x coordinates and the volumes. Used to access the x coordinates.
phi (array): electrostatic potential on a one-dimensional grid.
temp (float): Absolute temperature.
Returns:
defect_density (array): defect density for each site using their grid points
"""
defect_density = np.zeros_like( grid.x )
for site in self.sites:
i = index_of_grid_at_x( grid.x, site.x )
defect_density[ i ] += np.asarray( site.probabilities( phi_at_x( phi, grid.x, site.x ), temp ) ) / grid.volumes[ i ]
return defect_density
[docs] def subgrid_calculate_defect_density( self, sub_grid, full_grid, phi, temp ):
"""
Calculates the defect density at each site for a given subset of sites.
Args:
subgrid (object): Grid object - contains properties of the grid including the x coordinates and the volumes. Used to access the x coordinates. For a given subset of sites.
full_grid (object): Grid object - contains properties of the grid including the x coordinates and the volumes. Used to access the x coordinates. For all sites.
phi (array): electrostatic potential on a one-dimensional grid.
temp (float): Absolute temperature.
Returns:
defect_density (array): defect density for each site using their grid points
"""
defect_density = np.zeros_like( sub_grid.x )
for site in self.sites:
i = index_of_grid_at_x( sub_grid.x, site.x )
defect_density[ i ] += np.asarray( site.probabilities( phi_at_x( phi, full_grid.x, site.x ), temp ) ) / sub_grid.volumes[ i ]
return defect_density
return Set_of_Sites( [ site_from_input_file( line, defect_species ) for line in site_data ] )
return Set_of_Sites( [ site_from_input_file( line, defect_species ) for line in mirrored_data ] )


All-around transform for Browserify.
npm install broaderify
The initial motivation comes from the need to inject dependencies into modules that don't import them by themselves - bootstrap 3 for example, and by the flawed approach used by browserify-shim to deal with that problem:
Broaderify adopts a very similar strategy to webpack loaders: it allows full source transformation control based on module name filtering.
import * as Browserify from "browserify";
import broaderify from "broaderify";
Browserify()
.transform(broaderify, {
loaders: [{
filter: /foo.js/,
worker: (module, content, done) => {
// do whatever you want with content
done(content);
}
}]
})
.add('index.js');
Read the documentation for more information.
import * as Browserify from "browserify";
import broaderify from "broaderify";
let bundle = browserify()
.transform(broaderify, {
global: true,
loaders: [{
filter: /node_modules\/bootstrap\/js\/(.*).js/,
worker: (module, content, done) => {
content = 'var jQuery = require(\'jquery\');' + content;
done(content);
}
}]
})
.add('index.js');
Let's take parallax.js jQuery plugin as an example. It is a very good example because it makes the explicit assumption that jQuery is part of the window object:
import * as Browserify from "browserify";
import broaderify from "broaderify";
let bundle = browserify()
.transform(broaderify, {
global: true,
loaders: [{
filter: /node_modules\/parallax-js\/source\/jquery.parallax.js/,
worker: (module, content, done) => {
content = content.replace('window.jQuery || window.Zepto', 'jQuery');
content = 'var jQuery = require(\'jquery\');' + content;
done(content);
}
}]
})
.add('index.js');
Apache-2.0 © Eric MORAND
Generated using TypeDoc


-
1
class ApplicationController < ActionController::API
-
# protect_from_forgery with: :exception
-
1
helper_method :current_user, :log_in, :logged_in?
-
-
1
def current_user
-
@current_user ||= Family.find_by(id: session[:user_id])
-
end
-
-
1
def log_in family
-
session[:user_id] = family.id
-
end
-
-
1
def logged_in?
-
!!current_user
-
end
-
end
-
1
class TasksController < ApplicationController
-
1
before_action :require_login
-
-
1
def index
-
2
task = Task.all
-
2
render json: task
-
end
-
-
1
def create
-
@task = Task.new(task_params)
-
@task.family_id = current_user.family_id
-
if @task.save
-
respond_to do |format|
-
format.json {render json: @task}
-
end
-
end
-
end
-
-
-
1
private
-
1
def task_params
-
params.require(:answer).permit :title, :point_value, :assigned_member_id, :deadline
-
end
-
-
1
def require_login
-
2
if !current_user
-
flash[:error] = "You must be logged in."
-
end
-
end
-
end
-
1
class Event < ActiveRecord::Base
-
1
belongs_to :member
-
1
belongs_to :family
-
-
1
validates :title, :event_date, :event_time, :family, presence: :true
-
1
validate :event_in_future
-
1
validate :member_in_family
-
-
-
1
private
-
-
1
def event_in_future
-
10
if (event_date && event_date < Date.today)
-
errors.add(:event_date, "has already happened")
-
end
-
end
-
-
1
def member_in_family
-
10
if (self.member && self.member.family != self.family)
-
errors.add(:member, "is not in your family")
-
end
-
end
-
-
end
-
-
-
-
-
-
-
1
class Family < ActiveRecord::Base
-
1
has_secure_password
-
1
has_many :members
-
1
has_many :events
-
1
has_many :rewards
-
1
has_many :tasks
-
-
1
validates :surname, :email, :password, presence: true
-
1
validates :email, uniqueness: true
-
1
validates :password, length: { in: 6..20 }
-
end
-
1
class Medal < ActiveRecord::Base
-
1
has_many :members
-
-
1
validates :title, :img_url, presence: true
-
end
-
1
class Member < ActiveRecord::Base
-
1
belongs_to :family
-
1
has_many :events
-
1
has_many :rewards
-
1
has_many :assigned_tasks, foreign_key: :assigned_member_id, class_name: "Task"
-
1
has_many :completed_tasks, foreign_key: :completed_member_id, class_name: "Task"
-
-
1
validates :role, :name, :family, :img_url, :color, presence: true
-
1
validates :points, numericality: {only_integer: true}
-
-
end
-
1
class Reward < ActiveRecord::Base
-
1
belongs_to :family
-
1
belongs_to :member
-
-
1
validates :name, :cost, :family, presence: true
-
1
validates :cost, numericality: {only_integer: true, greater_than: 0}
-
1
validate :member_in_family
-
-
-
1
private
-
1
def member_in_family
-
16
if (self.member && self.member.family != self.family)
-
errors.add(:member, "is not in your family")
-
end
-
end
-
end
-
1
class Task < ActiveRecord::Base
-
1
belongs_to :family
-
1
belongs_to :assigned_member, class_name: "Member", foreign_key: :assigned_member_id
-
1
belongs_to :completed_member, class_name: "Member", foreign_key: :completed_member_id
-
-
1
validates :title, :point_value, :family, presence: true
-
1
validates :point_value, numericality: {only_integer: true}
-
1
validate :event_in_future
-
1
validate :assigned_member_in_family
-
1
validate :completed_member_in_family
-
-
-
1
private
-
1
def event_in_future
-
13
if deadline && deadline < Date.today
-
errors.add(:deadline, "has already happened")
-
end
-
end
-
-
1
def assigned_member_in_family
-
13
if (self.assigned_member && self.assigned_member.family != self.family)
-
errors.add(:member, "is not in your family")
-
end
-
end
-
-
1
def completed_member_in_family
-
13
if (self.completed_member && self.completed_member.family != self.family)
-
errors.add(:member, "is not in your family")
-
end
-
end
-
end
-
1
require File.expand_path('../boot', __FILE__)
-
-
1
require "rails"
-
# Pick the frameworks you want:
-
1
require "active_model/railtie"
-
1
require "active_job/railtie"
-
1
require "active_record/railtie"
-
1
require "action_controller/railtie"
-
1
require "action_mailer/railtie"
-
1
require "action_view/railtie"
-
1
require "sprockets/railtie"
-
# require "rails/test_unit/railtie"
-
-
# Require the gems listed in Gemfile, including any gems
-
# you've limited to :test, :development, or :production.
-
1
Bundler.require(*Rails.groups)
-
-
1
module HomeBase2
-
1
class Application < Rails::Application
-
# Settings in config/environments/* take precedence over those specified here.
-
# Application configuration should go into files in config/initializers
-
# -- all .rb files in that directory are automatically loaded.
-
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
-
# config.time_zone = 'Central Time (US & Canada)'
-
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
-
# config.i18n.default_locale = :de
-
-
# Do not swallow errors in after_commit/after_rollback callbacks.
-
1
config.active_record.raise_in_transactional_callbacks = true
-
-
1
config.action_dispatch.default_headers.merge!({
-
'Access-Control-Allow-Origin' => 'http://localhost:8000',
-
'Access-Control-Request-Method' => '*'
-
})
-
end
-
end
-
1
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-
-
1
require 'bundler/setup' # Set up gems listed in the Gemfile.
-
# Load the Rails application.
-
1
require File.expand_path('../application', __FILE__)
-
-
# Initialize the Rails application.
-
1
Rails.application.initialize!
-
1
Rails.application.configure do
-
# Settings specified here will take precedence over those in config/application.rb.
-
-
# The test environment is used exclusively to run your application's
-
# test suite. You never need to work with it otherwise. Remember that
-
# your test database is "scratch space" for the test suite and is wiped
-
# and recreated between test runs. Don't rely on the data there!
-
1
config.cache_classes = true
-
-
# Do not eager load code on boot. This avoids loading your whole application
-
# just for the purpose of running a single test. If you are using a tool that
-
# preloads Rails for running tests, you may have to set it to true.
-
1
config.eager_load = false
-
-
# Configure static file server for tests with Cache-Control for performance.
-
1
config.serve_static_files = true
-
1
config.static_cache_control = 'public, max-age=3600'
-
-
# Show full error reports and disable caching.
-
1
config.consider_all_requests_local = true
-
1
config.action_controller.perform_caching = false
-
-
# Raise exceptions instead of rendering exception templates.
-
1
config.action_dispatch.show_exceptions = false
-
-
# Disable request forgery protection in test environment.
-
1
config.action_controller.allow_forgery_protection = false
-
-
# Tell Action Mailer not to deliver emails to the real world.
-
# The :test delivery method accumulates sent emails in the
-
# ActionMailer::Base.deliveries array.
-
1
config.action_mailer.delivery_method = :test
-
-
# Randomize the order test cases are executed.
-
1
config.active_support.test_order = :random
-
-
# Print deprecation notices to the stderr.
-
1
config.active_support.deprecation = :stderr
-
-
# Raises error for missing translations
-
# config.action_view.raise_on_missing_translations = true
-
end
-
# Be sure to restart your server when you modify this file.
-
-
# Configure sensitive parameters which will be filtered from the log file.
-
1
Rails.application.config.filter_parameters += [:password]
-
# Be sure to restart your server when you modify this file.
-
-
# Your secret key for verifying the integrity of signed cookies.
-
# If you change this key, all old signed cookies will become invalid!
-
-
# Make sure the secret is at least 30 characters and all random,
-
# no regular words or you'll be exposed to dictionary attacks.
-
# You can use `rake secret` to generate a secure secret key.
-
-
# Make sure your secret_key_base is kept private
-
# if you're sharing your code publicly.
-
-
# Although this is not needed for an api-only application, rails4
-
# requires secret_key_base or secret_token to be defined, otherwise an
-
# error is raised.
-
# Using secret_token for rails3 compatibility. Change to secret_key_base
-
# to avoid deprecation warning.
-
# Can be safely removed in a rails3 api-only application.
-
1
HomeBase2::Application.config.secret_token = '388dbc0b1f7fd12c116efa608bd2f6e676337f54522759359da02a982ea09ecb0700fb82b026f44637da6d5fc143bbd30f45a05a54a2a15c92b58f392c7678d3'
-
# Be sure to restart your server when you modify this file.
-
#
-
# This file contains settings for ActionController::ParamsWrapper
-
-
# Enable parameter wrapping for JSON.
-
# ActiveSupport.on_load(:action_controller) do
-
# wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
-
# end
-
-
# To enable root element in JSON for ActiveRecord objects.
-
# ActiveSupport.on_load(:active_record) do
-
# self.include_root_in_json = true
-
# end
-
1
Rails.application.routes.draw do
-
# The priority is based upon order of creation: first created -> highest priority.
-
# See how all your routes lay out with "rake routes".
-
-
1
resources :families do
-
1
resources :members
-
end
-
-
1
resources :tasks, :events, :rewards
-
# You can have the root of your site routed with "root"
-
# root 'welcome#index'
-
-
# Example of regular route:
-
# get 'products/:id' => 'catalog#view'
-
-
# Example of named route that can be invoked with purchase_url(id: product.id)
-
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
-
-
# Example resource route (maps HTTP verbs to controller actions automatically):
-
# resources :products
-
-
# Example resource route with options:
-
# resources :products do
-
# member do
-
# get 'short'
-
# post 'toggle'
-
# end
-
#
-
# collection do
-
# get 'sold'
-
# end
-
# end
-
-
# Example resource route with sub-resources:
-
# resources :products do
-
# resources :comments, :sales
-
# resource :seller
-
# end
-
-
# Example resource route with more complex sub-resources:
-
# resources :products do
-
# resources :comments
-
# resources :sales do
-
# get 'recent', on: :collection
-
# end
-
# end
-
-
# Example resource route with concerns:
-
# concern :toggleable do
-
# post 'toggle'
-
# end
-
# resources :posts, concerns: :toggleable
-
# resources :photos, concerns: :toggleable
-
-
# Example resource route within a namespace:
-
# namespace :admin do
-
# # Directs /admin/products/* to Admin::ProductsController
-
# # (app/controllers/admin/products_controller.rb)
-
# resources :products
-
# end
-
end
-
1
FactoryGirl.define do
-
1
factory :family do
-
43
surname { Faker::Name.last_name }
-
43
email { Faker::Internet.email }
-
43
password { Faker::Lorem.characters(10) }
-
end
-
-
1
factory :member do
-
11
role { Faker::Lorem.characters(4) }
-
11
name { Faker::Name.first_name }
-
1
association :family, factory: :family
-
11
color { Faker::Lorem.characters(4) }
-
11
img_url { Faker::Internet.url }
-
end
-
-
1
factory :task do
-
11
title { Faker::Lorem.sentence }
-
11
point_value { Faker::Number.digit }
-
1
association :family, factory: :family
-
11
deadline { Faker::Date.forward(7) }
-
end
-
-
1
factory :event do
-
7
title { Faker::Lorem.sentence }
-
7
event_date { Faker::Date.forward(7) }
-
7
event_time { Faker::Time.forward(2)}
-
1
association :family, factory: :family
-
end
-
-
1
factory :reward do
-
8
name { Faker::Lorem.sentence }
-
8
cost { Faker::Number.number(3) }
-
1
association :family, factory: :family
-
end
-
-
1
factory :medal do
-
3
title { Faker::Lorem.sentence }
-
3
img_url { Faker::Internet.url }
-
end
-
-
end
-
1
require "rails_helper"
-
-
1
describe Event do
-
7
subject { FactoryGirl.create(:event) }
-
1
context "validations" do
-
2
it { should validate_presence_of :title }
-
2
it { should validate_presence_of :event_date }
-
2
it { should validate_presence_of :event_time }
-
2
it { should validate_presence_of :family }
-
end
-
-
1
context "associations" do
-
2
it { should belong_to(:member) }
-
2
it { should belong_to(:family) }
-
end
-
end
-
1
require "rails_helper"
-
-
1
describe Family do
-
10
subject { FactoryGirl.create(:family) }
-
1
context "validations" do
-
2
it { should validate_presence_of :surname }
-
2
it { should validate_presence_of :email }
-
2
it { should validate_uniqueness_of :email }
-
2
it { should have_secure_password }
-
1
it do
-
1
should validate_length_of(:password).
-
is_at_least(6).is_at_most(20)
-
end
-
end
-
-
1
context "associations" do
-
2
it { should have_many(:members) }
-
2
it { should have_many(:events) }
-
2
it { should have_many(:rewards) }
-
2
it { should have_many(:tasks) }
-
end
-
end
-
1
require "rails_helper"
-
-
1
describe Medal do
-
3
subject { FactoryGirl.create(:medal) }
-
1
context "validations" do
-
2
it { should validate_presence_of :title }
-
2
it { should validate_presence_of :img_url }
-
end
-
-
1
context "associations" do
-
# it { should have_many(:members) }
-
end
-
end
-
1
require "rails_helper"
-
-
1
describe Member do
-
11
subject { FactoryGirl.create(:member) }
-
1
context "validations" do
-
2
it { should validate_presence_of :role }
-
2
it { should validate_presence_of :name }
-
2
it { should validate_presence_of :family }
-
2
it { should validate_presence_of :color }
-
2
it { should validate_presence_of :img_url }
-
end
-
-
1
context "associations" do
-
2
it { should have_many(:events) }
-
2
it { should have_many(:rewards) }
-
2
it { should have_many(:assigned_tasks) }
-
2
it { should have_many(:completed_tasks) }
-
2
it { should belong_to(:family) }
-
end
-
end
-
1
require "rails_helper"
-
-
1
describe Event do
-
8
subject { FactoryGirl.create(:reward) }
-
1
context "validations" do
-
2
it { should validate_presence_of :name }
-
2
it { should validate_presence_of :cost }
-
2
it { should validate_presence_of :family }
-
2
it { should validate_numericality_of(:cost).only_integer }
-
1
it do
-
1
should validate_numericality_of(:cost).
-
is_greater_than(0)
-
end
-
end
-
-
1
context "associations" do
-
2
it { should belong_to(:member) }
-
2
it { should belong_to(:family) }
-
end
-
end
-
1
require "rails_helper"
-
-
1
describe Task do
-
7
subject { FactoryGirl.create(:task) }
-
1
context "validations" do
-
2
it { should validate_presence_of :title }
-
2
it { should validate_presence_of :point_value }
-
2
it { should validate_presence_of :family }
-
end
-
-
1
context "associations" do
-
2
it { should belong_to(:family) }
-
2
it { should belong_to(:assigned_member) }
-
2
it { should belong_to(:completed_member) }
-
end
-
end
-
1
module AuthenticationHelpers
-
1
def stub_current_user
-
2
allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(true)
-
end
-
-
end


🌎 Language
Minecraft 1.13, 1.14, 1.15, 1.16
Minecraft 1.15, 1.16
Minecraft 1.15, 1.16
Minecraft 1.16
Try the new improved generator!
Supports 1.16 world generation


Located close to Meppady and just 8 km south of Kalpetta, stands the highest peak of the Wayanad Hill Range. The Chembra Peak at an altitude of 2000 meters above sea level. The Chembra peak offers a panoramic view of not only the entire Wayanad district but also a large chunk of Kozhikode, Malappuram and Niligiri districts.The peak, its surrounding lush greenery and the famed heart-shaped lake make it a paradise for travellers to explore.
Wayanad Wildlife Sanctuary is the second largest wildlife sanctuary in Kerala and comprises of rare as well as endangered species of both flora and fauna.It is surrounded by the protected areas of Mudumalai in Tamil Nadu as well as Nagarhole and Bandipur in Karnataka.The sanctuary is spread over an area of 345 square km and comprises of two parts namely Upper Wayanad and Lower Wayanad. Eucalyptus, as well as bamboo trees, are grown in the region.
Also known as Sentinel Rock Waterfalls, Soochipara Falls is a three-tiered waterfall situated in Vellarimala, Wayanad.Surrounded by deciduous, evergreen and montane forests, this waterfall is regarded as one of the best waterfalls.The drive from Meppadi to Sentinel Rock Waterfalls provides visitors with scenic views of some of the best tea estates in Wayanad.
Vythiri is an ideal tourist destination with little cottages and resorts ornamenting its pleasant surroundings.It comprises of 18 villages.It is the place to be in if one wants to step back a little into the past and experience the simpler cottage life while having the urban and modern facilities available on demand to create a truly enjoyable experience.A popular resort town famous for its old world charm of cottages, log huts & tree house accommodations cosily nestled in the forests of Wayanad.


{% extends 'new_order.html' %} {% block menus_block %}
Select from these delicious ingredients what you want in your {{ item.name }} by typing in the number you want:
Max limit: {{ item.getLimit(ingredient_type) }}
{{error[ingredient_type]}}
{{error[ingredient.name]}}
Sorry, currently {{ ingredient.name }} is unavailable.


Select a node to view the type.
Select a node to view the definition.
Select a node to view the translation.
Select a node to view any dependencies.
Select a node to view the example.
Select a node to view the JSON schema.
JavaScript tool for visualizing json-schemas.
Interactive documentation tool for JSON schemas. Utilizes the D3.js library to build a collapsible tree from the supplied schema(s).
A tool to validate a json object using the supplied schema. Utilizes the tv4 library.
There's also a basic example without the jQuery Mobile interface elements.


{% extends "base.html" %} {% from "security/_macros.html" import render_field_with_errors, render_field %} {% include "security/_messages.html" %} {% block body %}
Instructions will be sent to the registered address entered below.
{% include "security/_menu.html" %}


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF KERALA AT ERNAKULAM Crl MC No. 1087 of 2007() 1. NCJ RAJAN, ... Petitioner 2. JOHN NEROTH, 3. JOHN MATHEW, 4. JOHN CHACKO, Vs 1. P.K.KUMUDINI, D/O. LATE KRISHNAN ... Respondent 2. M.P.SOURO, S/O. PAPPU, 3. N.J.CHACKO, DIRECTOR, 4. FRANCIS JOB NEROTH, For Petitioner :SRI.ROY CHACKO For Respondent :SRI.C.V.MANUVILSAN The Hon'ble MR. Justice R.BASANT Dated :08/06/2007 O R D E R R.BASANT, J. ---------------------- Crl.M.C.No.1087 of 2007 ---------------------------------------- Dated this the 8th day of June 2007 O R D E R
The petitioners are accused 1 and 3 to 5 in a prosecution under the provisions of 'The Water (Prevention and Control of Pollution) Act, 1974. It is alleged that they are directors of a company. The crux of the allegation is that the said company had committed offence of water pollution punishable under the Act in the locality in which it is working. The petitioners have come before this court with a prayer that the prosecution against them may be quashed invoking the extraordinary inherent jurisdiction available to this court under Section 482 Cr.P.C.
2. What are the reasons? The learned counsel for the petitioner has identified five specific reasons on the basis of which he claims quashing of proceedings. First of all, it is contended that no notice under Section 49 of the Act has been issued to the Pollution Control Board by the first respondent/ complainant before launching this prosecution. After discussions at the bar, this point is not seriously pressed. It is evident that this contention is not available to the petitioners in as much as there is specific averment in the complaint and Ext.P1 document Crl.M.C.No.1087/07 2 marked in the course of the sworn statement of complainant to show that notice under Section 49 of the Act had been issued to the Pollution Control Board before the complainant embarked on this prosecution.
3. The second contention raised is that the complaint is not maintainable in as much crucial averments to implicate the petitioners are not there in the complaint. Section 47(1) reads as follows:
47.Offences by companies- (1) Where an offence under this Act has been committed by a company, every person who at the time the offence was committed was in charge of, and was responsible to the company for the conduct of, the business of the company, as well as the company, shall be deemed to be guilty of the offence and shall be liable to be proceeded against and punished accordingly:
Provided that nothing contained in this sub- section shall render any such person liable to any punishment provided in this Act if he proves that the offence was committed without his knowledge for that he exercised all due diligence to prevent the commission of such offence.
(emphasis supplied)
4. The relevant averment against the accused persons on this aspect appears in paragraph 3 of the complaint which also I extract below:
"It is respectfully submitted that, 50 meters away from the residence of the complainant, there is a Crl.M.C.No.1087/07 3 Coir Factory in the name and style of M/s.N.C.John & Co (herein after referred as the Company in short), owned by the accused herein. The accused are the directors of the said company who are solely responsible for any crime committed by the company."
(emphasis supplied)
5. The learned counsel for the petitioner relies on various decisions on this aspect by courts culminating in the decision in SMS Pharmaceuticals Ltd. vs. Neeta Bhalla [2005(8) SCC 89] that was a decision rendered in relation to a prosecution under Section 138 read with Section 141 of the Negotiable Instruments Act. In the said decision, it has been held clearly and unambiguously that unless the requisite averments attracting culpability so far as the directors are concerned are made specifically in the complaint, cognizance should not be taken against such accused directors. It is unnecessary to advert to precedents earlier in SMS Pharmaceuticals Ltd. vs. Neeta Bhalla [2005(8) SCC 89]. After considering the entire law on the point, it has been held unambiguously that the requisite averments must be there in order to attract the culpable liability for the directors.
Crl.M.C.No.1087/07 4
6. That position of law is therefore well settled. The learned counsel for the complainant makes an attempt to contend that SMS Pharmaceuticals Ltd. vs. Neeta Bhalla [2005 (8) SCC 89] is applicable only to a prosecution like the one under Section 138 of the Negotiable Instruments Act where the offence alleged is comparatively insignificant and light and such an interpretation regarding the requirement of pleadings cannot be blindly imported into prosecution for a very serious offence like the one under the pollution laws. The offence alleged committed by the petitioners in this case affects posterity and therefore the principles of interpretation under Section 141 of the N.I.Act cannot be blindly imported. That contention may, of course, require serious consideration but cannot of course be readily accepted.
7. The learned counsel for the complainant then contends that it is not the law that the words of the statute must be repeated and reiterated in the complaint. The core of the issue is whether the requisite allegations have been raised against the accused who are directors of the company. Paragraph 3 extracted above, according to me, sufficiently notifies the accused persons of the nature of the allegations that Crl.M.C.No.1087/07 5 are raised against them. That they are solely responsible for the crime committed by the company is specifically and effectively narrated and communicated. The requirement of pleadings whether it be civil law or criminal law is that the adversary must be notified of the case on his opponent. The requirements of pleadings is not certainly an empty formality. This has its foundation in the principles of natural justice which demand that no persons must be condemned without being heard. Opportunity for being heard effectively includes the right to be notified of the allegations that he has to meet. Language of the statute need not be ritualistically repeated. It is sufficient if such averments are there which would effectively and cogently convey to the indictees the case which they have to meet. Materials and evidence in support of such pleadings will come only later. In this view of the matter, I am of the opinion that it may not be appropriate or proper to throw the prosecution out at the threshold invoking the extraordinary inherent jurisdiction on the ground that the averments in paragraph 3 extracted above are not succinct, sufficient and specific - that they do not repeat crucial and key words of the statute in Section 47(1) of the Act. This is not to say that I am totally satisfied with the nature of Crl.M.C.No.1087/07 6 pleadings. But the inadequacy of the pleadings must be realistically considered and undeserved benefit cannot be conferred on an indictee and he cannot be spared of the liability to face the trial only on such reason. Significantly, this is not a case where there are no averments at all. The averments in paragraph 3 extracted above indicate clearly that the accused are directors of the company and they are solely responsible for the acts of the company - that is the crime committed by the company. In these circumstances, I am certainly of the opinion that the trial must proceed and the court must wait for the evidence which is likely to be adduced, the core having been stated in paragraph 3 extracted above. The second contention raised cannot in these circumstances, justify this court invoking the powers under Section 482 Cr.P.C.
8. The third contention raised is that there are no relevant averments which can attract culpability under Section 47(2) of the Act. I agree with the learned counsel for the petitioner on this aspect. There is no contention that any consent or connivance was there on the part of the petitioners which resulted in the commission of the offence nor does the complainant have a specific case - it is evident on going through Crl.M.C.No.1087/07 7 the pleadings, that the petitioners are liable under Section 47(2) of the Act. The contention raised under Section 47(2) of the Act is therefore entitled to succeed but such success is irrelevant in view of the answer already given to contention No.2 referred above. Further, it is apposite to note that accused No.1 is alleged to be executive director and sixth accused is executive officer/alleged director as status. What the expression executive director and executive officer means will certainly have to be amplified in evidence by the complainant.
9. Fourthly it is contended that subsequent to the alleged act of pollution in this case, writ petition has been filed by the complainant along with another before the High court to ensure that the factory is closed down and does not continue to perpetuate the alleged pollution. Subsequently, commissions have been taken out in the court. These, according to me, are absolutely irrelevant in as much as the precise offence alleged has been committed in respect of period prior to the filing of the writ petition. I am not, in these circumstances, referring to the various materials that have been introduced in evidence, in the course of the writ petition. Significantly, there is no contention that the allegation made in the petition do not reveal the Crl.M.C.No.1087/07 8 commission of an offence under the Act by the company during the relevant period - i.e the period prior to the filing of the writ petition.
10. Fifthly and lastly it is contended that the Pollution Control Board has subsequently duly licensed the petitioner's company. The subsequent establishment of appropriate pollution plants and abatement of nuisance of pollution cannot certainly have the effect of obliterating or effacing the offence, if any already committed. In view of that also, the subsequent granting of licence by the Pollution Control Board cannot, in any way deliver any advantage to the petitioners.
11. No other contentions are raised. I am, in these circumstances, of the opinion that no circumstances have been brought out which would justify premature termination of the proceedings against the petitioners by invoking the extraordinary inherent jurisdiction under Section 482 Cr.P.C. It is unnecessary to advert to precedents which have been cited copiously at the Bar on this aspect. Suffice it to say that the jurisdiction which I am called upon to invoke and exercise is an extraordinary inherent jurisdiction which cannot be invoked as a matter of course and which ought to be invoked only sparingly Crl.M.C.No.1087/07 9 and in exceptional cases - in the rarest of rare cases as held in Kurukshetra University vs. State of Haryana [AIR 1977 SC 2229]. I am of the opinion that the materials available in this case [considering the nature of allegations, the gravity of the allegations and the precise conduct alleged as revealed from the circumstances] this is not a fit case where such a jurisdiction can and ought to be invoked. I must, however, hasten to observe that I have not intended to finally conclude any disputed question of fact or law and I have only chosen to hold that powers under Section 482 Cr.P.C need not be invoked at this stage and with the present materials.
12. This Criminal Miscellaneous Case is accordingly dismissed with the above observations.
(R.BASANT, JUDGE) jsr Crl.M.C.No.1087/07 10 Crl.M.C.No.1087/07 11 R.BASANT, J.
CRL.M.CNo.
ORDER 21ST DAY OF MAY2007


--- layout: null title: Kean's Blog permalink: / ---
Hi, I'm Kean :-) !
This is my personal blog site!
There are mainly tech blogs!
Actually, I do not write much -_-||
Talk is cheap, let's code!


Tropical Kiwi Mix
This fresh-flavored smoothie can satrt a day out right or perk up an afternoon
Contents
- Kiwi
- Banana
- Blackberry
- Avocado
| Amount | Unit |
|---|---|
| 196 | kkal |
| 1 g | fats |
| 46 g | carbohydrates |
| 5 g | protein |
This fresh-flavored smoothie can satrt a day out right or perk up an afternoon
| Amount | Unit |
|---|---|
| 196 | kkal |
| 1 g | fats |
| 46 g | carbohydrates |
| 5 g | protein |


| Recordings Being Played | Unload |
|---|---|
|
This app lets you record and play back multiple instances of your avatar in your Sandbox. Setup InstructionsIn your sandbox domain:
Now you can record and play back recordings in your domain! |
|
| Number of available instances: |


|
AceWire
0.3.2
Unified interface for selecting different I2C implementations on Arduino platforms
|
A version of SimpleWireInterface that uses one of the <digitalWriteFast.h> libraries. More...
#include <SimpleWireFastInterface.h>
Public Member Functions | |
| SimpleWireFastInterface ()=default | |
| Constructor. | |
| void | begin () const |
| Initialize the clock and data pins. More... | |
| void | end () const |
| Set clock and data pins to INPUT mode. | |
| uint8_t | beginTransmission (uint8_t addr) const |
| Send I2C START condition. More... | |
| uint8_t | write (uint8_t data) const |
| Send the data byte on the data bus, with MSB first as specified by I2C. More... | |
| uint8_t | endTransmission (bool sendStop=true) const |
| Send the I2C STOP condition. More... | |
| uint8_t | requestFrom (uint8_t addr, uint8_t quantity, bool sendStop=true) |
| Prepare to read bytes by sending I2C START condition. More... | |
| uint8_t | read () |
| Read byte. More... | |
| SimpleWireFastInterface (const SimpleWireFastInterface &)=default | |
| SimpleWireFastInterface & | operator= (const SimpleWireFastInterface &)=default |
A version of SimpleWireInterface that uses one of the <digitalWriteFast.h> libraries.
The biggest benefit of using digitalWriteFast is the reduction of flash memory size, 500-700 bytes on AVR.
The delayMicroseconds()
may not be accurate for small values on some processors (e.g. AVR) . The actual minimum value of T_DELAY_MICROS will depend on the capacitance and resistance on the DATA and CLOCK lines, and the accuracy of the delayMicroseconds()
function.
| T_DATA_PIN | SDA pin |
| T_CLOCK_PIN | SCL pin |
| T_DELAY_MICROS | delay after each bit transition of SDA or SCL |
Definition at line 52 of file SimpleWireFastInterface.h.
|
inline |
Initialize the clock and data pins.
These are open-drain lines, with pull-up resistors. We must not drive them HIGH actively since that could damage the transitor at the other end of the line pulling LOW. Instead, we go into INPUT mode to let the line to HIGH through the pullup resistor, then go to OUTPUT mode only to pull down.
Definition at line 66 of file SimpleWireFastInterface.h.
|
inline |
Send I2C START condition.
| addr | I2C address of slave device |
Definition at line 87 of file SimpleWireFastInterface.h.
|
inline |
Send the I2C STOP condition.
Definition at line 136 of file SimpleWireFastInterface.h.
|
inline |
Read byte.
After reading 8 bits, an ACK or NACK will be sent by the master to the slave. ACK means the slave will be asked to send more bytes so can hold control of the data line. NACK means no more bytes will be read from the slave and the slave should release the data line.
If requestFrom() was called with sendStop = true
, a STOP condition will be sent after reading the final byte.
If called when the number of remaining bytes is 0 (which should not happen if the calling program is correctly implemented), this method returns immediately with a 0xff.
Definition at line 184 of file SimpleWireFastInterface.h.
|
inline |
Prepare to read bytes by sending I2C START condition.
If sendStop
is true, then a STOP condition will be sent by read()
after the last byte.
Definition at line 154 of file SimpleWireFastInterface.h.
|
inline |
Send the data byte on the data bus, with MSB first as specified by I2C.
This loop generates slightly asymmetric logic signals because clockLow() lasts for 2*bitDelay(), but clockHigh() lasts for only 1*bitDelay(). This does not seem to cause any problems with the LED modules that I have tested.
Definition at line 110 of file SimpleWireFastInterface.h.


Home
Menu
Drinks
Reservation
Events
Location
Contact
Menu
Appetizers
Soups, Chili & Salads
Sandwiches & Handhelds
Craft Burgers
Tacos & Quesadillas
Ribs & Steaks
Chicken & Seafood
Sides
Desserts
Beverages
Kids Menu
Appetizers
Menu Item
Menu Item
Menu Item
Menu Item
Menu Item
Event Highlights
×


When: Saturday June 29, 2019
Where: Inner Soundness
Time: 10:00 am to 3:00 pm
Promotional Rate: $185 per person** 48-hour prepayment is required to RSVP.
Buy
Ticket
**The promotional rate is only for our 1st Self Hypnosis & Mindfulness workshop in June 2019. Regular rate for this workshop is $285.


The kitura create command is a command-line tool that provides a guided question-and-answer way to create Kitura Swift applications.
The generator supports two different ways to generate an application: scaffolding a starter and generating a CRUD application.
A scaffolded starter is an application containing boilerplate code but little or no application logic. You can use this as a base for your application by modifying the generated files with your application logic.
You can select from a number of different options presented by the generator to define extra content to be included in the resulting application. For example, these include things like adding the boilerplate for serving static files and creating connections to databases.
A CRUD (Create-Read-Update-Delete) application is one where you provide a description of a data model and the generator creates application code for a REST webservice that will provide endpoints to perform create, read, update and delete operations for data matching that data model. In the current version of the generator, most of the generated CRUD application is not open for modification or extension—expect this to change in a future version to allow for more flexibility.
Follow the Getting Started.
Prerequisities
Complete the following steps to install Swift Server Generator
npm install -g yo
npm install -g generator-swiftserver
Swift Server Generator is supported only on the following operating systems:
- > Ubuntu Linux 14.04 LTS
- > Ubuntu Linux 16.04 LTS
First, run the Kitura application generation (see Command line tools):
kitura create
Enter swiftserver-getting-started as the application name.
What's the name of your application? swiftserver-getting-started
Tip: You can use a different name for the application, but if you do, be sure to substitute your name for swiftserver-getting-started throughout the rest of this tutorial.
Press Enter to accept the default directory for the project (the same as the application name).
Enter the name of the directory to contain the project: (swiftserver-getting-started)
Select Scaffold a starter at the type of project prompt and press Enter.
Select type of project: (Use arrow keys)
❯ Scaffold a starter
Generate a CRUD application
Select Web at the application pattern prompt (this determines the default set of capabilities) and press Enter
Select capability presets for application pattern: (Use arrow keys)
Basic
❯ Web
Backend for frontend
Press Enter to accept the default capabilities for the Web application pattern.
Select capabilities: (Press {space} to select, {a} to toggle all, {i} to inverse selection)
❯ ◉ Static web file serving
◯ Swagger UI
◉ Embedded metrics dashboard
◉ Docker files
Press Enter to accept the default of not generating code from a swagger specification in the scaffolding.
Select endpoints to generate: (Press to select, {a} to toggle all, to inverse selection)
❯ ◯ Swagger file serving endpoint
◯ Endpoints from a swagger file
Press Enter to accept the default of not generating a Swift server SDK from a swagger file in the scaffolding.
Would you like to generate a Swift server SDK from a Swagger file? (y/N)
Press Enter to accept the default of not including any boilerplate for services in the scaffolding.
Generate boilerplate for services: (Press to select, {a} to toggle all, to inverse selection)
❯ ◯ Cloudant / CouchDB
◯ Redis
◯ MongoDB
◯ PostgreSQL
◯ Object Storage
◯ AppID
◯ Auto-scaling
The generator will display messages as it scaffolds and builds the application including:
Now you should have a generated application directory similar to this:
swiftserver-getting-started/
├── public/
├── Sources/
│ ├── Application
│ │ ├── Application.swift
│ │ ├── Metrics.swift
│ │ └── Routes/
│ │ └── HealthRoutes.swift
│ └── swiftserver-getting-started
│ └── main.swift
├── Package.swift
├── README.md
├── config.json
└── ...
For a description of the generated files, take a look at the structure of a generated project in the Project layout reference.
Change to the application directory:
cd swiftserver-getting-started
Start the application:
.build/debug/swiftserver-getting-started
Confirm the application is running locally by opening the URL http://localhost:8080 in your browser. You’ll see something like this:
Welcome to Kitura
Your Kitura based server is up and running!
Congratulations, you now have a simple Kitura web application ready for extension with your own application logic. Now you can:
The kitura create command creates a Kitura Swift application based on the project type, capabilities and services you select. To do this, use the command-line tools provided by installing the generator.
The project type defines whether the generated application is a scaffold or CRUD application.
This project type is for creating a starter application where you define all of the application logic yourself. The generator will create the directory structure and boilerplate code based on the capabilities and services you select.
You may modify any of the generated code and will not be expected to run the generator again on the generated project.
This project type is for creating a CRUD (Create-Read-Update-Delete) application where you provide a description of a data model and the generator creates application code for a REST webservice that will provide endpoints to perform create, read, update and delete operations for data matching that data model.
The data model is specified by using the model generator on the generated project to create each piece of the data model, or by using the property generator on the generated project to modify existing pieces.
Throughout the documentation we will use the following terminology:
Each time the data model is modified, parts of the project are regenerated to match the updated definition and the application will be rebuilt with swift build.
When you define a model it automatically comes with a predefined REST API with a full set of create, read, update, and delete operations. This REST API is described in more detail in Exposing Swift Server Generator models over REST.
You can create models by using the model generator, which creates a Model definition JSON file that defines your model. By convention, this file is located in the project’s models directory; for example, models/bookstore.json.
After a model and its properties have been defined, an OpenAPI (Swagger 2.0) specification is also generated that describes and documents the REST APIs. By convention, this is located in the project’s definitions directory; for example, definitions/bookstore.yaml.
You should not modify the code in the Sources/Generated directory, or the OpenAPI Swagger definition file in the definitions directory as any modifications will be lost when these files are regenerated.
Capabilities define chunks of functionality that will be implemented by the generated application. The application generator will ask you to select the capabilities you would like included.
For the scaffold project type, you can select from the following list:
For the CRUD project type, you can select from the following list:
The list allows for toggling of any combination of the available capabilities which will start with a default set selected.
The default set will depend on the project type:
This capability will include a public directory in the root of the project. The contents of this directory will be served as static content using the built-in Kitura StaticFileServer module.
This content is hosted on /. For example, if you want to view public/myfile.html and the application is hosted at https://localhost:8080, go to https://localhost:8080/myfile.html.
This capability is only available for scaffold projects.
This capability uses the SwiftMetrics package to gather application and system metrics.
These metrics can be viewed in an embedded dashboard on /swiftmetrics-dash. The dashboard displays various system and application metrics, including CPU, memory usage, HTTP response metrics and more.
This capability includes the following files for Docker and Kubernetes support:
The .dockerignore file contains the files/directories that should not be included in the built docker image. By default this file contains the Dockerfile and Dockerfile-tools. It can be modified as required.
The Dockerfile defines the specification of the default docker image for running the application. This image can be used to run the application.
The Dockerfile-tools is a docker specification file similar to the Dockerfile, except it includes the tools required for compiling the application. This image can be used to compile the application.
The chart folder contains pre-configured Kubernetes resources for this project. It allows the use of Helm to streamline the deployment of a docker image to the cloud.
To build the two docker images, run the following commands from the root directory of the project:
docker build -t myapp-run .
docker build -t myapp-build -f Dockerfile-tools .
You may customize the names of these images by specifying a different value after the -t option.
To compile the application using the tools docker image, run:
docker run -v $PWD:/root/project -w /root/project myapp-build /swift-utils/tools-utils.sh build release
To run the application:
docker run -it -p 8080:8080 -v $PWD:/root/project -w /root/project myapp-run sh -c .build-ubuntu/release/{app_executable}
This is the capability to generate a server SDK library from a swagger specification document, which can be used to allow the generated server application to call APIs on an external service. Providing the swagger document for the external service allows client-side Swift API stubs to be generated into the Routes directory.
This capability adds an endpoint to the application to provide file serving of an OpenAPI Swagger definition file for this application. This assumes that a pre-prepared Swagger document has been written and will be placed at definitions/{app_name}.yaml.
The endpoint is hosted on /swagger/api. For example, if the application is hosted at https://localhost:8080, go to https://localhost:8080/swagger/api.
This capability is only optional for scaffold projects and is always enabled in CRUD projects.
If the SwaggerUI capability and Swagger endpoint capability are enabled then specification of this interface is made available through an embedded Swagger UI hosted on /explorer. For example, if the application is hosted at https://localhost:8080, go to https://localhost:8080/explorer. The Swagger UI will document the paths and http methods that are supported by the application.
This capability will generate example or custom API endpoint code from an OpenAPI (swagger) document. If selected, then the fileserving endpoint capability is automatically enabled.
This capability includes an OpenAPI Swagger definition and routes for a Product example resource. The OpenAPI Swagger definition is located at definitions/{app_name}.yaml.
The user can choose to generate endpoints by specifing the path or URL to a swagger specification document.
This capability is only available for scaffold projects.
This capability uses an embedded Swagger explorer web page to load and display the OpenAPI Swagger definition in the user friendly explorer web page. Through the explorer page, the user can view and exercise the APIs documented within the Swagger document.
The services offered by the generator will depend on the project type and capabilities you have selected.
For CRUD project type no services are available except those that are implied by the CRUD store prompt.
These services are hosted on IBM Cloud and the application can connect to them either locally or when deployed to IBM Cloud.
When IBM Cloud services are selected, a set of deployment configuration files to support deploying your application to IBM Cloud are created:
The manifest.yml defines options which are passed to the Cloud Foundry cf push command during application deployment.
IBM Cloud DevOps service provides toolchains as a set of tool integrations that support development, deployment, and operations tasks inside IBM Cloud. The “Create Toolchain” button in the README.md creates a DevOps toolchain and acts as a single-click deploy to IBM Cloud including provisioning all required services.
You need to publish your project to a public github.com repository to use the “Create toolchain” button.
This service uses the Kitura-CouchDB package, which allows Kitura applications to interact with a Cloudant or CouchDB database.
CouchDB speaks JSON natively and supports binary for all your data storage needs.
Boilerplate code for creating a client object for the Kitura-CouchDB API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the Kitura-CouchDB client.
This service uses the Kitura-redis library, which allows Kitura applications to interact with a Redis database.
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports a cracking array of data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
Boilerplate code for creating a client object for the Kitura-redis API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the Kitura-redis client.
This service uses the Swift-Kuery-ORM which allows Kitura applications to interact with a PostgreSQL database.
Boilerplate code for creating a client object for the Swift-Kuery-ORM is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the PostgreSQL client.
This service uses the Object Storage package to connect to the IBM Cloud Object Storage service.
Object Storage provides an unstructured cloud data store, which allows the application to store and access unstructured data content.
Boilerplate code for creating a client object for the Object Storage API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the Object Storage client.
This service uses App ID package to connect to the IBM Cloud App ID service.
App ID provides authentication to secure your web applications and back-end systems. In addition App ID supports authentication using social identity providers so that users can login with their existing user accounts, such as Facebook and Google.
Boilerplate code for creating a client object for the App ID API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module. Extra routes and logic need to be added to make this a authentication boilerplate work. A working example can be found in the App ID README.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the App ID client.
This service uses the SwiftMetrics package for connecting to the IBM Cloud Auto-scaling service. You can use this to automatically manage your application capacity when deployed to IBM Cloud. You will need to define the Auto-Scaling policy (https://console.ng.bluemix.net/docs/services/Auto-Scaling/index.html) to define the rules used to scale the application.
The connection details for this client are loaded by the configuration boilerplate code and are passed to the SwiftMetrics auto-scaling client.
This service uses the Watson Swift SDK package, which allows Kitura applications to build Watson-powered applications, specifically in this case the IBM Watson Conversation service.
With the IBM Watson Conversation service you can create an AI assistant that combines machine learning, natural language understanding, and integrated dialog scripting tools to build outstanding projects, such as a chat room with an integrated Watson chat bot.
Boilerplate code for creating a client object for the Watson Conversation API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration code and are passed to the Watson Conversation client in the boilerplate code.
More information about the Watson Conversation can be found in the README.
This service uses the Alert Notification Service SDK package, which allows Swift developers to utilize the Alert Notifications service in their applications, allowing for the proactive remediation of issues for applications running on IBM Cloud. Alerts and messages can be created, received and deleted through the use of this SDK.
This SDK is for the consumption/usage of the Alert Notification service and not for administration of the service. Adding users, groups, notification policies, etc. should be done through the IBM Cloud dashboard.
Boilerplate code for creating a client object for the Alert Notification API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration code and are passed to the Alert Notification client in the boilerplate code.
A quick start guide to the Alert Notification Service on IBM Cloud can be found here.
This service uses the Push notifications package, which is a Swift server-side SDK for sending push notifications via the IBM Cloud Push Notifications service.
Boilerplate code for creating a client object for the Push Notifications API is included inside Sources/Application/Application.swift as an internal variable available for use anywhere in the Application module.
The connection details for this client are loaded by the configuration code and are passed to the Push Notifications client in the boilerplate code.
More information about the Push Notifications Service can be found in the README.
The following sections describe the prompts provided by the application generator.
If you did not supply an application name as an argument, the application generator will ask the name you would like to use for your application:
What's the name of your application? (currentDirectory)
The default value is the name of the current working directory.
The application name you enter must satisfy the following constraints:
The application generator will ask the name of the directory you would like to use for your application:
Enter the name of the directory to contain the project: (applicationName)
The default value is the name of the application.
If the directory name is the same as the current directory, then the generator will assume you want to create the project in direcly in the current directory rather than creating a subdirectory of the same name.
The application directory you enter must satisfy the following constraints:
The application generator will ask which type of project you would like to create, offering two options:
Select type of project: (Use arrow keys)
❯ Scaffold a starter
Generate a CRUD application
The Scaffold a starter option will direct the generator to create a scaffolded application providing boilerplate code and application structure to which your application logic can be added.
The Generate a CRUD application option will direct the generator to create a CRUD application on top of which a data model can be defined which will automatically be mapped to REST endpoints for create, read and update operations. At present the code for this type of application is not very customizable aside from modifying the data model.
For scaffolded applications, the application generator will ask which application pattern you want to select, offering three options:
Select capability presets for application pattern: (Use arrow keys)
❯ Basic
Web
The application pattern defines the capabilities that are selected by default in the subsequent capabilities prompt. They are presets and the capabilities they suggest can be modified as required.
The Basic pattern is intended for any type of application, making the fewest assumptions about the application logic. Selecting this pattern will result in the following defaults for the capabilities prompt:
◯ Static web file serving
◯ Swagger UI
◉ Embedded metrics dashboard
◉ Docker files
The Web pattern is intended for an application that needs to provide a web server hosting static files. Selecting this pattern will result in the following defaults for the capabilities prompt:
◉ Static web file serving
◯ Swagger UI
◉ Embedded metrics dashboard
◉ Docker files
The Backend-for-frontend (BFF) pattern is intended for an application that provides a microservice intended for consumption by a client application (for example, a web or mobile application). Selecting this pattern will result in the following defaults for the capabilities prompt:
◉ Static web file serving
◉ Swagger UI
◉ Embedded metrics dashboard
◉ Docker files
The application generator will ask which capabilities you want to select.
For Scaffold project type, the following capabilities are available:
Select capabilities: (Press {space} to select)
❯ ◯ Static web file serving
◯ Swagger UI
◉ Embedded metrics dashboard
◉ Docker files
For CRUD project type, the following capabilities are available:
Select capabilities: (Press to select)
❯ ◉ Embedded metrics dashboard
◉ Docker files
The list allows for toggling of any combination of the available capabilities which will start with a default set selected.
CRUD project type always enables the OpenAPI / Swagger endpoint
The capabilities selected by default when this prompt is shown depend on the project type:
For scaffolded applications, the application generator will ask which services you want to select.
Generate boilerplate for services: (Press to select)
❯ ◯ Cloudant / CouchDB
◯ Redis
◯ MongoDB
◯ PostgreSQL
◯ Object Storage
◯ AppID
◯ Auto-scaling
◯ Watson Conversation
◯ Alert Notifications
◯ Push Notifications
For CRUD applications, the application generator will ask how you want to store entities:
Select data store: (Use arrow keys)
❯ Memory (for development purposes)
Cloudant / CouchDB
Selecting Memory (for development purposes) will mean entities are stored in a simple memory-based database.
The memory data store is volatile and any data added will be lost when the application is stopped. As such, it is only suitable for development purposes.
Selecting Cloudant / CouchDB will add a local CouchDB service for entity storage.
The application generator will ask you which of the services you selected need to be configured, for example:
Configure service credentials (leave unchecked for defaults): (Press to select)
❯ ◯ Cloudant / CouchDB
◯ Redis
◯ Object Storage
Any services you do not select in this prompt will use default values.
For each service you select, a set of custom prompts will ask for the relevant connection details to be supplied.


Emojify
Start Tracking
Stop Tracking
Built using:
emojione
for emojis
clmtrackr
for face tracking
p5js
for drawing to canvas


Large chain grocery store carrying all the essentials
Smaller neighborhood styled chain known for it's friendly customer service and unique products
Taiwanese American Supermarket carrying a large variety of Asian goods


1 June 2009 - As of 06:00 GMT, 1 June 2009, 62 countries have officially reported 17 410 cases of influenza A(H1N1) infection, including 115 deaths.
The breakdown of the number of laboratory-confirmed cases by country is given in the following table and map.
Country
Cumulative total
Newly confirmed since the last reporting period
Cases
Deaths
Cases
Deaths
Argentina
100
0
63
0
Australia
297
0
150
0
Austria
1
0
0
0
Bahamas
1
0
1
0
Bahrain
1
0
0
0
Belgium
12
0
4
0
Bolivia
3
0
3
0
Brazil
18
0
8
0
Canada
1336
2
218
0
Chile
250
0
85
0
China
52
0
22
0
Colombia
20
0
3
0
Costa Rica
37
1
4
0
Cuba
4
0
0
0
Cyprus
1
0
1
0
Czech Republic
1
0
0
0
Denmark
1
0
0
0
Dominican Republic
2
0
0
0
Ecuador
39
0
7
0
El Salvador
27
0
16
0
Estonia
1
0
1
0
Finland
3
0
0
0
France
24
0
3
0
Germany
28
0
9
0
Greece
4
0
1
0
Guatemala
12
0
7
0
Honduras
2
0
1
0
Hungary
1
0
1
0
Iceland
1
0
0
0
India
1
0
0
0
Ireland
4
0
1
0
Israel
19
0
8
0
Italy
29
0
3
0
Jamaica
2
0
2
0
Japan
370
0
6
0
Korea, Republic of
33
0
0
0
Kuwait
18
0
0
0
Malaysia
2
0
0
0
Mexico
5029
97
119
12
Netherlands
3
0
0
0
New Zealand
9
0
0
0
Norway
4
0
0
0
Panama
107
0
0
0
Paraguay
5
0
5
0
Peru
36
0
5
0
Philippines
16
0
10
0
Poland
4
0
0
0
Portugal
1
0
0
0
Romania
3
0
0
0
Russia
3
0
1
0
Singapore
5
0
1
0
Slovakia
2
0
1
0
Spain
178
0
35
0
Sweden
4
0
0
0
Switzerland
8
0
4
0
Thailand
2
0
0
0
Turkey
4
0
2
0
United Kingdom
229
0
26
0
United States of America
8975
15
1048
4
Uruguay
11
0
9
0
Venezuela
2
0
2
0
Viet Nam
1
0
1
0
Grand Total
17410
115
1900
16


The InputPort classes are designed to read the state (high or low) of a GPIO pin on the Raspberry Pi. In the Linux operating system there are two ways of accessing the GPIO pins. The first, called the SYSFS method, is the standard and approved Linux technique. During SYSFS accesses each GPIO is exposed as a file in the filesystem and the GPIO is manipulated as if it were a file. The second method, called Memory Mapped access, treats the Raspberry Pi's RAM memory as if it were a file and the GPIO state is manipulated as if it were a bit at an offset in a virtual file.
The major difference between the two techniques is that the SYSFS method is considerably slower than Memory Mapped access. For example, a maximum read frequency of about 1KHz is obtainable with SYSFS whereas something in the order of 2.4MHz (yes, mega Hertz) is obtainable with the Memory Mapped technique on a Raspberry Pi 2. SYSFS is the approved "Linux Way". However, if you need the speed, Memory Mapped access is the way to go.
The RPICSIO library provides classes for both SYSFS and Memory Mapped access. The classes can be differentiated by the corresponding FS
and
MM
appended to their names. The InputPortFS class provides SYSFS access to the GPIO
and the InputPortMM class provides Memory Mapped access.
When should you use SYSFS or Memory Mapped access? Well, in testing, both seemed pretty robust and trouble free. If you need a read frequency greater than about 500Hz (beware the Nyquist Frequency) you'll definitely want to use the InputPortMM class - otherwise the InputPortFS class will probably suffice. Both classes are used in exactly the same way and have exactly identical public members.
The example code below uses a GPIO value of 4 which is exposed as pin 7 on the header. In general, on the Raspberry Pi 2, these GPIOs are available for input or output by default. However it is possible to adjust the pinmux with the device tree to use header pins for alternate devices. If you are messing about with the Device Tree you will probably know what you have configured specific pins to use.
The GPIOs themselves can be either outputs or inputs and it is possible to configure internal pull-up or pull-down resistors on an input. The act of creating an RPICSIO InputPort class on a GPIO will configure it as an input. However, you will need to configure the pull-up or pull-down resistors as required. The InputPort class has function calls for this purpose.
Always be aware that the Raspbian Linux running on the Raspberry Pi is not a real-time operating system. This means, for example, although you might set up an InputPort() object to read at 10000 times a second, the actual timing of some of the reads may vary (and there may be lengthy gaps) as the process is pre-emptively swapped in and out by the kernel.
Be aware of the RPI max input voltage (3.3v) and pullup/pulldown resistors. Be really careful about the voltage you provide here. In general it is usually a good idea to run the input through some sort of buffer to clamp the max input at the RPI maximum.
IMPORTANT NOTE: Before creating any RPICSIO Port class you will need to ensure that the RPICSIO Library knows which type of Raspberry Pi you are dealing with. This is done by executing a call (only once is necessary) like the one below somewhere in your code before you create any port.
RPICSIOConfig.Instance.RPIType = RPITypeEnum.RPITYPE_RPI2;
The code below illustrates how to use the InputPortMM class to read the state of a GPIO pin and output that state to the console. You could use the SYSFS
version by replacing each InputPortMM
with
an InputPortFS
.
/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Reads a GPIO port until a key is pressed and puts the value (true or false) /// out to the console. Memory mapped version /// /// NOTE: /// Be aware of the RPI max input voltage and pullup/pulldown resistors. /// Be really careful about the voltage you provide here. In general it /// is usually a good idea to run the input through some sort of buffer /// to cap the max input at the RPI maximum. /// /// STANDARD NOTE: /// Be aware that you have to tell RPICSIO what type of Pi you are using. This /// is done by issuing the call below somewhere before you open any port. It /// only needs to be done once (replace the '2' with a 3 or 0 as appropriate). /// /// RPICSIOConfig.Instance.RPIType = RPITypeEnum.RPITYPE_RPI2; /// /// SIMPLE Test Harness /// connect a wire to GPIO_4 (pin 7) /// /// Once you have done that the issue a call like /// outTest.SimpleReadPortMM(GpioEnum.GPIO_4); /// /// then ground the wire by touching it to pin 39 (gnd) and then pin 17 (3.3v). /// This should generate a series of lows and highs the state of which will be /// output to the screen. /// /// </summary> /// <param name="gpioID">The gpioID</param> /// <history> /// 01 Dec 16 Cynic - Originally written /// </history> public void SimpleReadPortMM(GpioEnum gpioID) { // open the port InputPortMM inPort = new InputPortMM(gpioID, GPIOPullUpDownModeEnum.PULLUPDOWN_DOWN); // look for the input until we have a keypress on the console while (Console.KeyAvailable == false) { bool inVal = inPort.Read(); Console.WriteLine ("inVal = "+inVal.ToString()); // sleep for a second Thread.Sleep(1000); } // close the port inPort.ClosePort(); inPort.Dispose(); }In the above code, the
gpioID
is passed in when the function was called. This value is a member of the
GpioEnum class
which lists all possible GPIO's which
can be present on the Raspberry Pi. The above code is called via a line which looks like:
SimpleReadPortMM(GpioEnum.GPIO_4);


{{preheader}}
{{reportedUser.username}} was reported by {{reportingUser.username}} for reason: "{{reason}}"
User being reported:
{{reportedUser.name}} (@{{reportedUser.username}})
Reported by:
{{reportingUser.name}} (@{{reportingUser.username}})


Here, I can talk about some of the coding projects that I've done.
Scaled Down Version of Minecraft built using OpenGL and GLSL. Incorporates custom features such as AI bird flocks that implement the boiding algorithm and procedural terrain generation with various biomes
Click here to see the full project code.A scaled down version of the Maya editing software. Uses OpenGL and GLSL to create a Mesh with the ability to add vertices and manipulate JSON 3D model files. Also allows for meshes to be attached to skeletons and moved around through linear transformations
Click here to take a look at the codeUsing python scripts, we analyzed 60 days of Crime at Penn to see how crimes were distributed throughout the day, geographically located, and what kind of crimes were happening. We then created a frontend site on heroku to map our findings
Click here to see the site.Created during my Summer Internship, these scripts can help deploy a server monitoring system using the Prometheus-Grafana stack inside of docker containers. Useful for sysadmins and developers interested in diagnostics.
Click here to take a look at the codeDeveloped in conjunction with a group, this is a full stack food app that allows different users to let other users know when they are handing out free food, which shows up as posts. The backend is NodeJS while there is a frontend web component as well as Android App developed in android studio.
Click here to see the full project code.We took 500 facebook posts off of University of Pennsylvania student run facebook pages and created various graphics. Sentiment analysis was used using the NLTK library in python, and graphs were created using the matplotlib library.
Click here to take a look at the codeThis project was done for the University of Pennsylvania Distributed Systems Laboratory. It is an anonymous communications system designed to hide user metadata from a wide range of adversaries.
This is a web app designed for the Penn Aerospace Club's Balloon team. Our team conducts high altitude balloon launches. This app takes in data from an iridium satellite regarding the balloon's altitude, speed, location, and creates a map representation of that data.
The app, built in nodeJS, has its source code here (link)This was my first project done under the Distributed Systems Lab. In this project, I created JavaScript webscrapers using Chrome's Puppeteer API.
Then, the HTTP headers were statistically analyzed for signs of cache hits and cache misses.
Click here to see the full project code.This was a project demonstrating Java GUI features, built using the Swing Library. It is a variant of chess that values capturing pieces as opposed to a checkmate endstate. Comes with points counter, round indicator, and maps out the possible moves of every piece each round.
Click here to take a look at the codeThis was my first project integrating HTML, CSS and JavaScript
It is just a tip calculator with a very basic percentage slider and input box for the meal cost.
Here's the link to the project code.A remake of the popular 2048 game in Java, one of my first coding projects.
Click here to take a look at the codeA version of Connect 4 in Java. This incorporates both singleplayer and 2 player. The singleplayer mode has a very basic AI with offensive and defensive features, with decision making based off of weighting the offensive and defensive moves accordingly.
Here's the link to the project code.


Share your screen (PC o MacOS) with others by a link without sign-in.
Funime allows any non-registered user to share their screen with other users via a link or a 6-digit code. It can be used at any time as it does not require registration by the creator of the room or by the visitor.
Support the project by putting a star on the
repository or help me complete the project if you have web development skills.
Funime is currently optimized for browsing on Chrome (PC, Mobile), Opera and Firefox.