scibeam.core package¶
Submodules¶
scibeam.core.base module¶
Base functions for mixin classes and module width constants
-
scibeam.core.base.
_mixin_class
¶ list(str) – Specify allowed mixin class for method chain. The two basic data structures are TOFSeries and TOFFrame, current.
Note
TODO: Move Defaults to a seperate config.py file for easy configuration
-
class
scibeam.core.base.
Defaults
[source]¶ Bases:
object
Module level default values
Settings for global default values
Note
TODO: realize these using a seperate config.py file
-
data_file_extenstion
= '.lvm'¶
-
data_file_num_column
= 2¶
-
file_regex
= '.*_(\\d+\\.?\\d+).*.lvm$'¶
-
subfolder_regex
= '.*(\\d+\\.?\\d+).*'¶
-
scibeam.core.common module¶
Common functions used across classes and modules
-
scibeam.core.common.
winPathHandler
(args)[source]¶ A windows path string handler
Convert windows path string variables to python/linux compatible Path
Parameters: args (string) – A single or list of strings of path Returns: Reformated string of list of strings Return type: string
-
scibeam.core.common.
loadFile
(filename, cols=2, usecols=None, skiprows=0, kind='txt', sep='\t')[source]¶ File loader
Loading txt / lvm data files
Parameters: - filename (string) – Filename string (including the full path to the file)
- cols (int) – Total number of columns to be loaded, default 2
- usecols (int) – Column to be used, if None then load all. Default None
- skiprows (int) – Number of rows to skip when loading data, this is specifically designed for the case that there is header in the file
- kind (string) – File format, default ‘txt’. Currently only works for txt-like files
- sep (string) – Seperator of the data column, default ‘ ‘
Returns: data loaded as numpy ndarray, default 2D array
Return type: numpy.ndarray
Raises: FileNotFoundError
– File not found with given filename stringValueError
– Data loading didn’t finish
scibeam.core.descriptor module¶
scibeam.core.dictfunc module¶
-
scibeam.core.dictfunc.
buildDict
(init_dict, key, value)[source]¶ build dictionary with key and values on top of existing dict
Add / set key,value pair to a given dict. If the same key exists, combine values to list under the same key If no same key exists, creat new key and initialize it to single value
Parameters: - init_dict (dictionary) – original dictionary where new key, value pair to be added to
- key (dictionary key) – The key of dictionary that the value will be associated to
- value (dictionary value) – The value that associated to the key provided
Returns: If the given key is already exist in the given dictionary init_dict, the function checks if type(init_dict[key]) == list: if true, append value the list init_dict[key]; if false, change the value of init_dict[key] to be a list [init_dict[key], value]
if the given key is not in init_dict, creat a new key entry and assign its value to value (not type list).
Return type: dictionary
scibeam.core.formatter module¶
-
scibeam.core.formatter.
format_dict
(rawdict, alphabetical=True, digits=2)[source]¶ dictionary to string format
Format dictionarys to strings as a list of key value pairs in each row , meant for printing, annotation on plot, etc.
Parameters: - rawdict (dictionary) – raw input dictionary
- alphabetialy (bool) – if true (default) arrange dict key alphabetical
- digits (int) – number of digits to keep if the value the key is numerical
Returns: Formated string in seperate rows
Return type: string
scibeam.core.gaussian module¶
-
class
scibeam.core.gaussian.
Gaussian
[source]¶ Bases:
object
Class for numerical gaussian funciton application
A collections of methods for gaussian analysis on the data, such as single gaussian function, single gaussian 1d fitting, double gaussian, double gaussian fitting, etc.
-
static
doubleGaus
(x, a1, x1, sigma1, a2, x2, sigma2, y0=0)[source]¶ Gaussian function of two independent variables
Double gaussian function with offset :: y = a1 * exp((x - x1)^2 / (2 * sigma1^2) + a2 * exp((x - x2)^2 / (2 * sigma2^2))
Parameters: - x (float) – Input variable for the double gaussian function
- a1 (float) – Amplitude of the first gaussian variable peak
- x1 (float) – Peak center for the first variable gaussian peak
- sigma1 (float) – Sigma vlaues for the two gaussian peaks
- a2 (float) – Amplitude of the second gaussian variable peak
- a2 – Amplitude of the first gaussian variable peak
- x2 (float) – Peak center for the first variable gaussian peak
- sigma2 (float) – Sigma vlaues for the two gaussian peaks
- y0 (float) – Y offset, optional, default y0 = 0
Returns: Return type: Numerical value of the double gaussian function
-
static
doubleGausFit
(x, y, guessPara, offset=False)[source]¶ Two independent variable gaussian fitting
Fit the data with a double gaussian function base on given x, y data and initial guess parameters.
Unlike the 1D gaussian fitting function, one hase to provide initial guess parameters to make sure optimal parameters could be found.
The fitting method is based on least square method, fitted parameters and their covariance matrix is returned.
Parameters: - x (1D array) – Input data x value
- y (1D array) – Input data y value
- guessPara (array-like) – Initial guess parameter list[a1, x1, sigma1, a2, x2, sigma2, y0]
Returns: - array1 – Fitted parameter array [a1, x1, simga1, a2, x2, simga1]
- array2 – Cnveriance matrix of fitted parameters
-
static
gaus
(x, A, x0, sigma, offset=0)[source]¶ gaussian function with or without offset
General form of a 1D gaussian function, with variable as first parameter and other associate parameters followed. Can be used for fitting or line plotting after fitting is done.
The function generally follow the form :: y = A * exp(-(x - x0)^2 / (2 * sigma^2)) + offset (optional)
Handles the case with and without offset seperatelly, since for fitting without offset at all one has to force the function to be of not offset.
Parameters: - x (float) – variable x in gaussian function
- A (float) – Peak value
- x0 (float) – Center coordinates
- sigma (float) – Standard deviation
- offset (float) – overall offset, default 0
-
static
gausFit
(x, y, offset=False, plot=False)[source]¶ Perform gaussian fit on given data
Fit data with 1D gausian function :: y = a * exp((x - x0)^2 / (2 * sigma)) + y0(optional)
The function generates initial guesses automatically based on given data, the algorithm is based on scipy curve_fit function
Parameters: - x (array-like) – X values of the input data
- y (array-like) – Y values of the input data
- offset (bool) – Wether fit gaussian with offset or not Default False
- plot (bool) – Wether plot the fitting result or not Default False
Returns: - array1 – Array of optmized best fit data [a, x0, sigma, y0]
- array2 – A 4 x 4 covariant matrix of the corresponding optmized data
Raises: RuntimeError
– When optimized parameters not found within max depth of iteration
-
static
scibeam.core.numerical module¶
-
scibeam.core.numerical.
bandPassFilter
(data, tStep=None, lowFreq=0, highFreq=10000.0)[source]¶ band pass filter based on fourier transform
Filter the noise in time series data with given frequency range.
The data has to be in numpy array. If only 1D array is provided, one also needs to provide time step size. If 2D array is provided, the 0th column will be used to calculate time step size, while the 1st column will be treated as the signal value.
Parameters: - data (numpy array) – The input time series data. 1d array is treated as the signal value, which requires input parameter tStep to be not None.
- tStep (float) – Time step size in seconds of the time series data. If None (default), 0st columns in data will be treated as time and time step size will be extracted from there
- lowFreq (float) – Lower bound of the bandpass filter, default 0 Hz
- highFreq (float) – Upper bound of the bandpass filter, default 1e4 Hz
Note
The data has to be uniformly sampled, e.g. same time gap between each data point, all parameters here are supposed to be SI unit.
-
scibeam.core.numerical.
integrate
(x=None, y=None, kind='numerical', func=None, args=())[source]¶ numerical / functional integration
Perform integration on either numerical data or on a function.
The numerical intergration is based on given parameter x and y, based on numpy function trap; while the functional integration is based on given function and numpy function quad.
Parameters: - x (1D array) – THe x axis values for numerical data, default None
- y (1D array) – The y axis values for numerical data, default None
- kind (string) – Specify the integration method, options are: ‘numerical’, ‘function’ default ‘numerical’
- func (function) – The function to be integrated, default None
- args – arguments for function quad
scibeam.core.peak module¶
-
class
scibeam.core.peak.
SeriesPeak
(*args, **kwargs)[source]¶ Bases:
pandas.core.series.Series
Peak analysis on 1D labeled / unlabeled data
Build on top of pandas.Series, this adds more methods on peak analysis for pandas series data. The any class instance of SeriesPeak can still access all pandas sereis methods.
By default, the indexes is treated as the time axis, while the values of series is the data value.
Additionally, SeriesPeak is also designed as a mixin class which can be used as a method chain in other pandas dataframe / sereis based data formats.
-
self
¶ pandas series – pandas series data
-
__init__
(*args, **kwargs)[source]¶ assign value to initialize SeriesPeak
The initlization of this class can be done exactly as one initlize pandas series, for more information please pandas series documentation.
-
fwhm
(gauss_fit=False, offset=False)[source]¶ Full-Width-Half-Maximium
Find the Full-Width-Half-Maximium (FWHM) of the peak, from gaussian fitting or direction calculation.
Parameters: - gauss_fit (bool) – If true, fwhm is get from gaussian fitting If false (default), fwhm is from direction calculation
- offset (bool) – If True, the gaussian fitting will consider also fit the data offset. If False (default), the fitting procedure will assume that the data has 0 offset.
Returns: peak full-width-half-maximium value
Return type: float
-
gausFit
(plot=False, offset=False)[source]¶ Fit series with gausssian function
This gasussian fit function assumes the time or x-axis values is given by series index, while the measurement data or y-axis values is given by the values of sereis.
Optionally the one can choose to plot the fitted gaussian curve together with the raw data to visuallize the fitting property.
Parameters: - plot (bool) – If True a plot will be generated with raw data and fitted gaussian curve. Others no plot will be generated. Default False.
- offset (bool) – If True, the gaussian fitting will consider also fit the data offset. If False (default), the fitting procedure will assume that the data has 0 offset.
Returns: - popt (1D array) – optimized parameters of gaussian fitting. [A, x0, sigma, y0(optional)] Where A: peak height of gaussian function x0: peak center x coordinates sigma: standard deviation y0: offset. Only exist if parameter offset is set to be ‘True’
- pcov (2D array) – Covariance matrix of fitted parameters corresponding to popt
-
height
(gauss_fit=False, offset=False)[source]¶ calculate peak height
Calculated the peak height, either by gaussian fitting (if gauss_fit true), or simply return the maximium as the peak height (default)
Parameters: - gauss_fit (bool) – If true, the peak height is get by performing a gaussian fit If false, simply the maximium value in the given data
- offset (bool) – If True, the gaussian fitting will consider also fit the data offset. If False (default), the fitting procedure will assume that the data has 0 offset.
Returns: Peak height
Return type: float
-
idx
(gauss_fit=False, offset=False)[source]¶ find x-axis value corresponding to peak
This funciton is to locate the corresponding x corrdinate or ‘index’ of the peak. Depend on the value of parameter ‘gauss_fit’, the x coordinate of peak can either come from the max value or gaussian fitting.
The index of series is treated as the x coordinate of the data.
Parameters: - gauss_fit (bool) – If true, the x coordinate corresponding to peak is get by performing gaussian fitting on the data, as in member method gausFit. If false, the maxmium value of data will be treated as the ‘peak’, and its corresponding x coordinate will be returend.
- offset (bool) – If True, the gaussian fitting will consider also fit the data offset. If False (default), the fitting procedure will assume that the data has 0 offset.
Returns: The x coordinate that corresponding to the peak
Return type: float
-
nidx
(gauss_fit=False, offset=False)[source]¶ number index of the peak
Similar to member method idx, this one returns the number index rather than the real index, which means self.index[nidx] = idx
-
region
(n_sigmas=4, plot=False, offset=False)[source]¶ Auto find the peak region
Locate the region where there exists a peak and return the lower and upper bound index of the region.
-
sigma
(n_sigmas=1, gauss_fit=False, offset=False)[source]¶ Find peak width
Find the peak width, with specified mutiples of standard deviation. The width can be obtained by literally calculate the full-width-half-max or by gaussian fitting, depend on the parameter value ‘gauss_fit’ to be true of false.
Parameters: - n_sigmas (integer) – Multiplies of standard deviations of the peak width is wanted
- gauss_fit (bool) – If true, the peak width is obtained from gaussian fitting If False (default), the peak width is calculated from literally full-width-half-max.
- offset (bool) – If True, the gaussian fitting will consider also fit the data offset. If False (default), the fitting procedure will assume that the data has 0 offset.
Returns: The peak width in terms of multiples of standard deviatioins
Return type: float
-
scibeam.core.plot module¶
-
class
scibeam.core.plot.
PlotTOFFrame
(dataframe, lowerBound=None, upperBound=None, index_label=None, column_label=None)[source]¶ Bases:
object
Plot dataframe with time as index and another numerical variable as column labels
-
contour
(n_contours=5, n_sigma=2, xlabel='time', ylabel='value', title='contour plot', label=None, ax=None, image=False, **kwargs)[source]¶ contour plots for 2D self.data
-
contourf
(n_contours=5, n_sigma=2, xlabel='time', ylabel='value', title='contour plot', label=None, ax=None, **kwargs)[source]¶ contourf plots for 2D self.data
-
data
¶
-
scibeam.core.regexp module¶
-
class
scibeam.core.regexp.
RegMatch
(regStr)[source]¶ Bases:
object
-
match
(strings, group=1, asNumber=True)[source]¶ Match a single or list of regularizations to a single or list of strings Return as a dictionary
-
matchFolder
(folder_path, asNumber=True, group=1)[source]¶ Match files in the folder content with self.regex if two regex are in the self.regex, then the match is done in a recursive way, that first regex get matched, and the 2nd regex is applied to the match result from the first one.
-
regex
¶
-
scibeam.core.tofframe module¶
-
class
scibeam.core.tofframe.
TOFFrame
(*args, **kwargs)[source]¶ Bases:
pandas.core.frame.DataFrame
Time-Of-Flight (TOF) DataFrame
Subclassing pandas.DataFrame with extral methods / properties for time-series analysis
Parameters: - data (numpy ndarray (structured or homogeneous), dict, or DataFrame) – Dict can contain Series, arrays, constants, or list-like objectsSingle time-of-flight data analysis Value of measurement, e.g. voltage, current, arbiturary unit signel, shape(len(labels), len(times))
- index (numpy ndarray, iterables) – Time axis for time-of-flight
- columns (str, int, or float) – label of different tof measurement, e.g. pressure, temperature, etc
-
static
find_time_idx
(time, *args)[source]¶ Generator of time index for a given time value args: can be 1,2,3, or [1,2] or [1,2,3]
-
classmethod
from_file
(filePath, lowerBound=None, upperBound=None, removeOffset=True, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Generate TOFFrame object from a single given file
-
classmethod
from_matchResult
(path, matchDict, lowerBound=None, upperBound=None, removeOffset=True, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Creat TOFFrame from a RegMatch resutl dictionary
-
classmethod
from_path
(path, regStr, lowerBound=None, upperBound=None, removeOffset=True, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Buid TOFFrome instance from given file folder Current only works for ‘ ‘ seperated txt and lvm file
-
peak
¶ alias of
scibeam.core.peak.FramePeak
-
plot2d
¶ alias of
scibeam.core.plot.PlotTOFFrame
-
scibeam.core.tofframe.
read_folder
(path, regStr, lowerBound=None, upperBound=None, removeOffset=True, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Create TOFFrame class instance by reading in group of files in a folder matched by regex
Parameters: - path (str) – folder path, linux style or windows style as “raw string”, e.g. r”C:UserDocumentFolderName”
- lowerBound (int or float) – time axis lower boundrary limit for data
- upperBound (int or float) – time axis upper boundrary limit for data
- removeOffset (bool) – if True (default) remove data offset (set floor to 0 in no-signal region)
- offset_margin_how ({"outer", "outer left", "out right", "inner", "inner left", "inner right"}, default "outer") –
Specify the way to handle offset margin, offset floor value is calculated by averaging the value in a given range relative to data lower and upper boundrary, with avaliable options:
- ”outer” (default): from both left and right side out of the [lowerBound, upperBound] region
- ”outer left”: like “outer” but from only left side
- ”outer right”: like “outer” but from only right side
- ”inner”: from both left and right side inside of the [lowerBound, upperBound] region
- ”inner left”: like “inner” but from only left side
- ”inner right”: like “inner” but from only left side
- offset_margin_size (int) – Number of values to use for averaging when calculating offset
- skiprows (int) – number of rows to skip when read in data
- sep (str, defult " ") – seperator for columns in the data file
- Returns –
- -------- –
- of class TOFFrame (Instance) –
-
scibeam.core.tofframe.
read_regexp_match
(path, matchDict, lowerBound=None, upperBound=None, removeOffset=True, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Create instance of TOFFrame from regular expression match result dictionary using scibeam class RegMatch
Parameters: - path (str) – path of the targeted data folder
- matchDict (dictionary) – result dictionary form scibeam.regexp.RegMatch, or user specified dictionary with key as measurement label, value as file name string
- lowerBound (int or float) – time axis lower boundrary limit for data
- upperBound (int or float) – time axis upper boundrary limit for data
- removeOffset (bool) – if True (default) remove data offset (set floor to 0 in no-signal region)
- offset_margin_how ({"outer", "outer left", "out right", "inner", "inner left", "inner right"}, default "outer") –
Specify the way to handle offset margin, offset floor value is calculated by averaging the value in a given range relative to data lower and upper boundrary, with avaliable options:
- ”outer” (default): from both left and right side out of the [lowerBound, upperBound] region
- ”outer left”: like “outer” but from only left side
- ”outer right”: like “outer” but from only right side
- ”inner”: from both left and right side inside of the [lowerBound, upperBound] region
- ”inner left”: like “inner” but from only left side
- ”inner right”: like “inner” but from only left side
- offset_margin_size (int) – Number of values to use for averaging when calculating offset
- skiprows (int) – number of rows to skip when read in data
- sep (str, defult " ") – seperator for columns in the data file
Returns: Return type: Instance of TOFFrame
scibeam.core.tofseries module¶
-
class
scibeam.core.tofseries.
TOFSeries
(*args, **kwargs)[source]¶ Bases:
pandas.core.series.Series
-
classmethod
from_file
(file_path, lowerBound=None, upperBound=None, removeOffset=True, cols=2, usecols=None, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Buid TOF instance from given file Current only works for ‘ ‘ seperated txt and lvm file
-
peak
¶ alias of
scibeam.core.peak.SeriesPeak
-
plot1d
¶ alias of
scibeam.core.plot.PlotTOFSeries
-
classmethod
-
scibeam.core.tofseries.
read_file
(file_path, lowerBound=None, upperBound=None, removeOffset=True, cols=2, usecols=None, offset_margin_how='outer', offset_margin_size=20, skiprows=0, sep='\t')[source]¶ Read from sngle file and create an instance of TOFSeries
Parameters: - file_path (str) – path to file
- lowerBound (int or float) – time axis lower boundrary limit for data
- upperBound (int or float) – time axis upper boundrary limit for data
- removeOffset (bool) – if True (default) remove data offset (set floor to 0 in no-signal region)
- cols (int) – Total number columns in the data file
- usecols (int) – The index of column that will be used out of total number of columns cols
- offset_margin_how ({"outer", "outer left", "out right", "inner", "inner left", "inner right"}, default "outer") –
Specify the way to handle offset margin, offset floor value is calculated by averaging the value in a given range relative to data lower and upper boundrary, with avaliable options:
- ”outer” (default): from both left and right side out of the [lowerBound, upperBound] region
- ”outer left”: like “outer” but from only left side
- ”outer right”: like “outer” but from only right side
- ”inner”: from both left and right side inside of the [lowerBound, upperBound] region
- ”inner left”: like “inner” but from only left side
- ”inner right”: like “inner” but from only left side
- offset_margin_size (int) – Number of values to use for averaging when calculating offset
- skiprows (int) – number of rows to skip when read in data
- sep (str, defult " ") – seperator for columns in the data file
- Returns –
- -------- –
- of class TOFSeries (Instance) –


GBook - PHP Guestbook
- Version: 1.7 from 20th August 2009
- Author: Klemen Stirn
- PHP Guestbook
- PHP Scripts from PHPJunkyard.com
- Support and developers forum
INDEX
- Copyright notice
- Description, requirements and and thanks
- Installation
- Upgrading from old versions
- HELP and Troubleshooting
- Customizing GBook
- More free scripts, newsletter, ratings...
- Changelog
COPYRIGHT NOTICE
Copyright 2004-2009 Klemen Stirn. All Rights Reserved.
The GBook may be used and modified free of charge by anyone AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT. By using this code you agree to indemnify Klemen Stirn from any liability that might arise from it's use.
Selling the code for this program, in part or full, without prior written consent is expressly forbidden.
Using this code, in part or full, to create derivate work, new scripts or products is expressly forbidden. Obtain permission before redistributing this software over the Internet or in any other medium. In all cases copyright and header must remain intact. This copyright is in full effect in any country that has International Trade Agreements with the United States of America or with the European Union.
Removing copyright notice ("Powered by" links)
Removing any of the copyright notices without purchasing a license is expressly forbidden. To remove GBook copyright notice you must purchase a license. For more information on how to obtain a license please visit the page below:
http://www.phpjunkyard.com/copyright-removal.php
DESCRIPTION
Set up a Guestbook on your Web site using this PHP script. Comes with many features and good anti-SPAM protection.
What's new in 1.7
- New user interface (new tableless design, new style.css file, images have alt and title tags, valid XHTML)
- All HTML code has been moved to templates (easier to modify, share templates, add new emoticons, ...)
- Improved JunkMark anti-SPAM filter
- New anti-SPAM feature: a customized anti-SPAM logical question
- Improved Captcha anti-SPAM image
- You can now manually approve new posts
- You can limit length of Comments
- You can limit the number of Emoticons (Smileys) per post
- Customers can receive an e-mail notification when administrator replies to their post
- Removed go.php file (didn't really serve it's initial purpose)
REQUIREMENTS
- A server with working PHP 4.3.2 or newer
THANKS TO
I would like to say THANKS to everyone who in any way contributed to the development of this script, especially to (in no particular order):
- Henrie from the Netherlands for his continuing dedication to help GBook users on the support forum (www)
- Mauricio Samy Silva, designed the nice readme file you are just reading (www)
- Everyone who supported my work by purchasing a license
- Everyone who posted their suggestions, comments and feedback on the PHPJunkyard forum
» Installation
Please take 5 minutes and read the installation instructions carefully and completely! This will ensure a proper and easy installation.
If you have problems/questions see the "HELP and Troubleshooting" section further down.
- Open file settings.php in your favorite PLAIN TEXT editor (like Notepad or Wordpad on Windows systems, DO NOT use MS Word or similar editor) and set these variables:
Variable Description/Setup $settings['apass'] This will be your password for the admin panel. Change it from the default password admin. Use only letters a-Z, A-Z and numbers 0-9 $settings['website_title'] A short title of your Web site, like "My lovely Web site" $settings['website_url'] URL of your Web site (not guestbook!). $settings['gbook_title'] Title of your guestbook, like "My Web Site Guestbook" $settings['admin_email'] Your e-mail address where new entry notifications will be sent. $settings['gbook_url'] URL of the gbook.php script. For example http://www.yourdomain.com/guestbook/gbook.php New in version 1.7
$settings['spam_question']A question people will have to answer correctly in order to submit your guestbook. If used correctly this can be an easy but very effective anti-SPAM filter! You can use HTML code in the question. Set to 0 to disable the anti-SPAM question.
Don't use the default question! Make up a unique one with a simple and obvious answer.
A good question should be unique and have a simple answer everyone knows. Some examples:
Type access code ABCDE here: (answer: ABCDE)
Access code from the bottom of our homepage:
(place the answer to your homepage)
Are you a human? (answer: yes)
How much is 4 plus 11? (answer: 15)
Is Mars a planet (yes or no)? (answer: yes)
etc...New in version 1.7
$settings['spam_answer']The correct answer to your anti-SPAM question. Answers are not CaSe SeNSiTiVe.
TIP: Want to get GBook up and running as soon as possible?
 JUST CONTINUE WITH STEP 2 BELOW.$settings['notify'] If set to 1 you will receive an e-mail notification at your admin e-mail address every time a new entry is added to your guestbook. Set to 0 if you don't want to be notified. New in version 1.7
$settings['notify_visitor']If set to 1 visitors will receive an e-mail notification when you reply to their post (only if they entered their e-mail address when signing the Guestbook). Set to 0 to disable sending notifications. New in version 1.7
$settings['man_approval']Set to 1 to manually approve all new posts before they appear in the Guestbook. When someone submits a new Guestbook entry you will receive an e-mail notification with a link to approve or reject the post. If approved, the post will appear in the Guestbook, otherwise it will be deleted. Set to 0 to disable manual approval. New in version 1.7
$settings['template']Name of the template you are using. It must match the name of the folder with all required template files inside the templates folder (or your GBook will not work at all!). More information about templates and customizing them can be found further down the page.
Leave this set to 'default' at first to make sure your GBook works normally!
Note:
On most server folder names (and thus template names) are CaSe SeNSiTiVe! Settings 'default' and 'Default' will not work the same!$settings['logfile'] Name of the file where posts will be stored. I strongly recommend that you rename this file from the default name entries.txt to some hard-to-guess name, for example g3isht39a.txt $settings['use_url'] As of version 1.4 you can easily enable/disable the "Your Web site:" field of the GBook. Set to 1 to enable people posting their Web site URL and 0 to disable. This option has been added to further minimize the odds of people posting your guestbook just to advertise their Web site. The Your Web site field is DISABLED by default since version 1.4 $settings['url_blank'] If set to 1 if you want all URLs to be opened in a new window (target="_blank"). GBook will still validate as XHTML Transitional but not as Strict. Set to 0 to disable. $settings['use_private'] If set to 1 your visitors will have an option to make their post PRIVATE (not publicly displayed and readable only with admin password). Set to 0 to disable private posts. $settings['hide_email'] Setting to 1 will hide e-mail addresses from public and require admin password to view them. Set to 0 to disable.
RECOMMENDED SETTING: $settings['hide_email']=1;
NOTE:
If you wish to hide e-mail addresses I also recommend that you change $settings['logfile'] from the default "entries.txt" to some other hard to guess name, like "g3isht39a.txt"$settings['smileys'] If set to 1 text like :), ;) etc will be replaced by smileys (image icons). Individual visitors will still be able to disable smileys for their entry. If you don't want to allow smileys set to 0. New in version 1.7
$settings['max_smileys']Limit the number of smileys (emoticons) that can be used per post. Set to 0 for unlimited smileys. $settings['filter'] If set to 1 all new posts will be filtered for bad words and replaced by * * *. $settings['filter_lang'] The language of bad words file. For now only English language is supported so you can only use "en" (CaSe SeNSiTiVe). Please read section "Adding / Translating bad words list" further down for info on how to add/translate bad words. $settings['autosubmit'] Setting this to 1 or 2 will require entering a "security number" in order to successfully submit a new entry to the guestbook. I have added this to prevent SPAMing the guestbook. Set to 0 if you want to disable the security number check.
Setting to 1 will display the security number in a generated image. For this to work your server must have GD library installed. You can test if your server supports all the required functions by uploading the gd_test.php file to your server and open it in your browser. If you get a red image with text WORKS your server shouldn't have problems with it. If you get an error when opening gd_test.php try using the text version as explained below or ask your hosting company to install the GD library for PHP.
Setting to 2 will display the security number in text format. While this is not as effective as an image it will still block the majority of known spam robots.
RECOMMENDED SETTING: $settings['autosubmit']=1;
OR if the above doesn't work try
RECOMMENDED SETTING: $settings['autosubmit']=2;$settings['filter_sum'] This variable is used in the preventing automated submissions and is just a little trick that should make it all even more reliable. The idea is to set this to some random sequence of chars and numbers, for example dhjx72js. It doesn't really matter how long it is, but you should use only chars (a-zA-Z) and digits (0-9). Don't leave the default value (as it would loose the whole point), set it to something of your own. Examples would be g3oyf98, p9ak85i, h398dgf and similar. Again, DO NOT USE these examples, just type some chars of your own!
This is one of the most important anti-SPAM setting so don't forget to set it!$settings['junkmark_use'] JunkMarkTM is a filter, designed to catch spammers who actually visit your guestbook and get past the security number check. Setting this variable to 1 will enable JunkMarkTM, setting it to 0 will disable it. JunkMarkTM calculates probability of a message being SPAM and gives it a score between 0 (not SPAM) and 100 (SPAM). The higher the score the more likely the message is SPAM
RECOMMENDED SETTING: $settings['junkmark_use']=1;$settings['junkmark_limit'] Set to the score after which messages are rejected as SPAM. Messages which are given a JunkMarkTM score same or higher to this limit will not be added to the guestbook. Possible values are between 0 and 100. I don't recommend setting it below 50! The optimal value is around 60 to 70.
RECOMMENDED SETTING: $settings['junkmark_limit']=61;$settings['junkmark_ban100'] If set to 1 Gbook will automatically ban IP if the JunkMark score is 100 (meaning 100% SPAM). Set to 0 to disable automatic banning.
RECOMMENDED SETTING: $settings['junkmark_ban100']=1;$settings['ignore_proxies'] Setting to 1 will ignore proxy servers from calculation of JunkMark score. Set to 0 to disable.
RECOMMENDED SETTING: $settings['ignore_proxies']=0;$settings['show_nospam'] If set to 1 a small banner promoting "NO GUESTBOOK SPAM" with a link to my Guestbook SPAM article will be placed at the bottom of your guestbook. Not required, but very welcome and you help notifying people about the guestbook SPAM problem and how to avoid it. Set to 0 to disable the banner. $settings['one_per_session'] If set to 1 each person will be able to make only one post per browser session. As of version 1.33 you can officially disable this by setting this variable to 0.
RECOMMENDED SETTING: $settings['one_per_session']=1;New in version 1.7
$settings['max_comlen']The maximum leght (number of chars) of comments people can post. Set to 0 for unlimited length. $settings['max_word'] The maximum length of each line of comments. This is to prevent long "words" like ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff from stretching your guestbook. $settings['language'] Name of the language file (file with the translated text). More information about translating GBook is further down in the readme file. $settings['allow_IPv6'] If set to 1 if your server uses IPv6 protocol. Should be disabled on most servers. -
Save and close the settings.php file.
Don't forget to rename the entries.txt file to the name you set as $settings['logfile'] in settings.php! -
Connect via FTP to the public folder of your server where the rest of your Web site is, usually called "public_html," "www" or "site," and create a folder where you will install GBook (for example named "gbook" or "guestbook").
Example: /public_html/gbook
Corresponding URL: http://www.yourdomain.com/gbookTIP: Learn how to FTP and CHMOD files, read my simple FTP and CHMOD tutorial
-
Upload all GBook files to this folder.
Make sure the following files/folders are writable by the script:
- files banned_ip.txt and entries.txt - on Unix (Linux) servers CHMOD this file to 666 (rw-rw-rw-)
- directory apptmp - on Unix (Linux) servers CHMOD this directory to 777 (rwxrwxrwx)
If you have done all this your guestbook should work now. In your browser open your GBook, for example:
http://www.yourdomain.com/gbook/gbook.php and test it. You can delete messages by clicking the red [X] icon and entering your admin password.
Good luck with the script!
» Upgrading from old versions
Please take 5 minutes and read the upgrade instructions carefully and completely! This will ensure a proper and easy upgrade.
To upgrade from a previous version to 1.7 follow these steps:
- BACKUP YOUR EXISTING GBOOK FILES! Don't skip this step! Really, don't!
- Edit the new settings.php file (more info under "Installation") as new variables have been added
- Delete these files from the GBook folder on your server:
- go.php
- index.htm
- smileys.htm
- style.css
- Upload ALL files to your server except: entries.txt, header.txt and footer.txt
- CHMOD folder apptmp to 777 (rwxrwxrwx)
- If not already, CHMOD file banned_ip.txt to 666 (rw-rw-rw)
- Test everything. All your current posts should stay intact.
Good luck with the script!
» Troubleshooting
1. What is CHMOD and FTP?
I have prepared a simple FTP and CHMOD tutorial which will help you FTP files to your server and set correct CHMOD settings.
2. My guestbook doesn't work, HELP!
Here are a few things to check:
- Did you upload the entries.txt file and RENAMED it to the name you set as $settings['logfile'] in settings.php
- Are entries.txt (or the file named as set under $settings['logfile'] in settings.php) and banned_ip.txt files writable? CHMOD them to 666 (rw-rw-rw) if you are on a UNIX server
- Is apptmp folder writable? CHMOD it to 777 (rwxrwxrwx) if you are on a UNIX server
- Do you have a valid setting for $settings['template']? Does it match the name of your template folder (inside the templates directory)?
- If images don't display correctly check if you uploaded them (the entire "images" folder) correctly. The images folder must be place within the guestbook folder, for example http://www.yourdomain.com/guestbook/images
- Go through the entire setup process again carefully
- You should get more information about PHP errors (such as the exact file and line where the error occurred) by deleting this code from the settings.php file:
ini_set('display_errors', 0); ini_set('log_errors', 1);
Once GBook is working normally you should paste the code back into the settings.php file!
3. The security number image/text doesn't work (show up)?
For the image to work your server must have GD library installed. You can test if your server supports all the required functions by uploading the gd_test.php file to your server and open it in your browser. If you get an error when opening gd_test.php you should either ask your hosting company to install the GD library for PHP or try with $settings['autosubmit'] set to 2. This will display the security number in text format which is not as effective but better than nothing.
If you get the red WORKS image but the security image still doesn't work you probably have problems with sessions. Ask your hosting company to check PHP sessions configuration. Same thing if $settings['autosubmit'] set to 2 doesn't work.
4. I installed GBook but I still get many SPAM messages?
Make sure you have the latest version of GBook and that you have variables $settings['autosubmit'] set to 1 or 2 and $settings['junkmark_use'] set to 1. Also make sure the variable $settings['junkmark_limit'] is not set too high or too low (recommended value is 60) and that you have changed variable $settings['filter_sum'] as explained under Installation.
5. May I use JunkMarkTM SPAM filter in my other scripts?
No, you are not allowed to use JunkMarkTM SPAM filter in any other script (commercial or open source) without my express written permission. It may only be used in GBook and scripts that are direct derivates of GBook (customized/modified versions).
6. How can I ban an IP address?
Select "Ban IP address" when deleting a post or viewing IP address from GBook.
You can manually ban an IP address by adding IP% to the banned_ip.txt file. For example to ban IP <IP_ADDRESS> add this to the banned_ip.txt file:
<IP_ADDRESS>%
You don't have to put it in a new line, IPs can be listed like this:
<IP_ADDRESS>%321.321.321.321%<IP_ADDRESS>%
7. How can I remove an IP address from ban?
Open banned_ip.txt, find and delete the IP address you wish to stop banning, save changes and you're done!
Since this script is free no support is guaranteed. You will find solutions for some common problems below. If you can't get the script to work please go through this readme file again carefully and repeat the installation step-by-step (also delete old files and folders from the server). Also please feel free to FIRST SEARCH for solutions and then post any questions or problems you might have to PHPJunkyard forum (you can access it using username php and password php, then register for an account)!
» Customize header and footer
To quickly and easily modify the header and footer of your guestbook you can edit header.txt and footer.txt files. Simply paste the HTML code you want to appear before GBook (just after  tag) in the header.txt and code that should appear after GBook (just before ) in the footer.txt file. Use only valid (X)HTML code without any  or  tags.
You will have to use full image URLs in the code. For example instead of  use ! Same goes for any Javascripts or CSS files if you are calling them from within the header or footer.
» Templates (customize the look and feel)
As of version 1.7 GBook support templates that will allow full control over GBook look and feel, easy switching between templates and sharing custom templates with other users.
Important: before modifying templates make sure your GBook works 100% correctly with the default template!
Templates are located inside the templates folder. Each template is located within a separate folder, for example template default is located inside templates/default folder.
Template files have *.php extensions, you can open the files in any plain text editor. They contain valid XHTML code along with some PHP code (for printing variables). Feel free to modify the HTML code, but do not modify any PHP code (starts with <?php and ends with ?>) unless you are familiar with PHP as this code is used to insert text and data into the templates.
Note: on many servers template names are CaSe SeNSiTiVe!
--» Template folder format and contents
These are the files and folders included in the 'default' template:
/default (folder with template) |- /images (folder with images used) | |- /emoticons (folder with smileys used) | |- admin_reply.php |- admin_tasks.php |- comments.php |- emoticons.php |- emoticons_popup.php |- error.php |- no_comments.php |- overall_footer.php |- overall_header.php |- sign_form.php |- style.css
- Description on files and folders:
File/Folder Description/Details default This is the folder that contains all template files. This is also the template name because the name of this folder is used in the $settings['template'] variable in the settings.php file. If you want to create template named "Very Dark" you could name the folder for example very_black. images Folder with all the images used in the template (and thus GBook). emoticons Folder inside the images directory that contains all the emoticons (smileys) used by this template (and thus GBook). admin_reply.php Contains the form that GBook owner (administrator) uses to reply to guestbook entries admin_tasks.php Contains the form that GBook owner uses for tasks like viewing IP address, deleting posts and viewing e-mail addresses. comments.php Contains the code for the box that is used to display comments (guestbook entries). emoticons.php Contains a list of emoticons (smileys) used by the template. You can add more smileys to the guestbook (template) like this:
Step 1: upload the new smiley image to the images/emoticons folder.
Step 2: add this code to the emoticons.php file:":!code:" => "image.gif",
:!code: will be the text inserted and later replaced with the image.gif. For example if you want to upload smiley image love.gif you would add something like this to the emoticons.php file:":!love:" => "love.gif",
emoticons_popup.php Pop-up window that lists all available emoticons (those set in the emoticons.php file) when you click the "More..." link next to sample emoticons in the Sign Guestbook form. error.php Page that shows when an error occurs. no_comments.php Page that shows when the guestbook is empty (no entries have been submitted yet). overall_footer.php Bottom (footer) code that appears in all GBook pages except emoticons_popup.php. overall_header.php Top (header) code that appears in all GBook pages except emoticons_popup.php. sign_form.php Form used for signing the guestbook. style.css Contains all the CSS code used by the template. All the classes and IDs have a gbook_ prefix.
The code inside is CSS (Cascading Style Sheets); you can learn CSS here (it's quite simple and you can easily edit all colors with it).
--» Create a new template
A few tips for creating a new template.
- Before modifying template make sure your GBook works 100% correctly with the default template!
- Choose a name for your new template, for example Dark Knight. Create a new directory inside the templates folder that will contain all the files for the new template. Name it to something like dark_knight. I recommend using only lowercase letters (a-z), digits (0-9) and underscores (_).
- Copy all the files from the default template to your new folder.
- Set the $settings['template'] to the name of your new template, for example:
$settings['template'] = 'dark_knight'; - Make small changes to the template files and test them to make sure GBook is still working as expected.
- It is best to start with files style.css, overall_header.php, overall_footer.php and comments.php
- If GBook became empty after modifying the template it is probably an error in the code. You should get more information about PHP errors (such as the exact file and line where the error occurred)
by deleting this code from the settings.php file:
ini_set('display_errors', 0); ini_set('log_errors', 1);
Once GBook is working normally you should paste the code back into the settings.php file!
» Translating GBook to your language
To translate GBook to your language follow these steps:
- Locate file language.inc.php and open it in a plain text editor like Notepad or Wordpad.
- Save the file as yourlanguage.inc.php (deutsch.inc.php, francais.inc.php, ...).
- Edit the language file header (first lines that start with *) with your information. Please follow the provided format.
- Translate all lines containing language. You may translate only the right side of each line, for example:
$t['DO_NOT_CHANGE_THIS']='TRANSLATE WORDS HERE';
When translating make sure to:
- keep the line format: single quotes (') around each phrase and lines must end with a semi-colon (;)
- if you use single quotes in the words escape them with a backslash (\). WRONG: can't CORRECT: can\'t
- do not change these codes as they are used by GBook: %s %d
- Save the file and upload it to your server.
- Edit the $settings['language'] setting in your settings.php and upload the modified file to your server.
- Test GBook with your language and make sure it works ok.
- If possible you should also translate this readme.htm file (please name it readme-yourlanguage.htm, for example readme-fr.htm, readme-de.htm, ...).
If you translate GBook to your language please post it to the PHPJunkyard forum for others to download.
» Adding / Translating bad words list
To add new bad words open the en.php file (located in badwords folder) in your favorite PLAIN TEXT editor (like Notepad or Wordpad on Windows systems, DO NOT use MS Word or similar editor), find the comment saying INSERT NEW BAD WORDS BELOW THIS LINE and add new bad words in this format:
"BADWORD" => "REPLACEMENT",
For example if "asfhkjhfasf" is a bad word you would add this line to the file:
"SomeNastyWord" => "* * *",
Don't forget to add a comma ( , ) after the line!
If you are translating the bad words file I suggest you leave the English words and add new ones in your language as explained above. Then save the file as two letter country code php file. For example, if you are translating the file in French, you should save the file as fr.php (CaSe SeNSiTiVe!). Upload fr.php to your "badwords" folder, go to settings.php again and set $settings['filter_lang'] to "fr" (file name without .php).
Now test the GBook again. If you get an Error or Warning when you try to post a new message this means something is wrong with your language file. It either can't be found (check the name of the file, on most servers names are CaSe SeNsiTiVe!) or something is wrong with PHP syntax in it (make sure all the words are added in
"BADWORD" => "REPLACEMENT", syntax).
Please send me the translated file. If you translate the bad words file to your language please send it to info AT phpjunkyard DOT com (or contact me through PHPJunkard.com contact form) and I will make it available to others for download. You may include your name, Web site URL and e-mail address and I will give you proper credit (translated by John Doe. Visit www.yourwebsite.com).
» Copyright removal
You may NOT edit or remove any copyright or Powered by statements in Gbook code without purchasing a license! For more information please visit http://www.phpjunkyard.com/copyright-removal.php» Stay updated!
Join my FREE newsletter and you will be notified about new scripts, new versions of the existing scripts
and other important news from PHPJunkYard.
Click here for more info
» Please rate this script
If you like this script please rate it or even write a review at:
Rate this Script @ Hot Scripts
Rate this Script @ The PHP Resource Index
» Get more useful FREE scripts!
Looking for more PHP scripts? Here is a list of PHPJunkyard FREE scripts:
- Help Desk Software
- Click and download counter
- Reciprocal links manager
- Guestbook (this script)
- Message board
- Text hit counter
- Graphical hit counter
- Random image
- Random text
CHANGELOG
What's new in 1.7
- New user interface (new tableless design, new style.css file, images have alt and title tags, valid XHTML)
- All HTML code has been moved to templates (easier to modify, share templates, add new emoticons, ...)
- Improved JunkMark anti-SPAM filter
- New anti-SPAM feature: a customized anti-SPAM logical question
- Improved Captcha anti-SPAM image
- You can now manually approve new posts
- You can limit length of Comments
- You can limit the number of Emoticons (Smileys) per post
- Customers can receive an e-mail notification when administrator replies to their post
- Removed go.php file (didn't really serve it's initial purpose)
Changes in 1.6
- added an option to hide e-mail addresses (enabled by default)
- added an option to open links in a new window (if enabled code will validate as XHTML Transitional but not Strict)
- added an option to exclude proxies from JunkMarktm calculation
- IPv6 addresses can now be accepted
- all text used is now in a separate file for easier translating
- some changes to the interface and style file
- fixed wordwrap of HTML entities
Changes in 1.5
- Gbook is now XHTML 1.0 valid (set to Transitional, but valdiates also as Strict)
- added IP address banning
- added fixes for two most common problems with sessions
- improved anti-SPAM features
- multiple empty lines will now be reduced to only one empty line
- fixed display of special language characters
© Copyright PHP Scripts from PHPJunkyard 2004-2009. All rights reserved.


This is the simple paragraph.
Do you like this blog? If you want one like this for yourself you can contact me at: XXX-XXX-XXX


| 027:081 Khan | : |
Nor can you lead the blind out of their error, you can only make to hear those who believe in Our Ayat (proofs, evidences, verses, lessons, signs, revelations, etc.), and who have submitted (themselves to Allah in Islam as Muslims). |
| 027:081 Maulana | : |
Nor canst thou lead the blind out of their error. Thou canst make none to hear except those who believe in Our messages, so they submit. |
| 027:081 Pickthal | : |
Nor canst thou lead the blind out of their error. Thou canst make none to hear, save those who believe Our revelations and who have surrendered. |
| 027:081 Rashad | : |
Nor can you guide the blind out of their straying. The only ones who will hear you are those who believe in our revelations, and decide to be submitters. |
| 027:081 Sarwar | : |
You cannot guide the straying blind ones. You can only make hear those who believe in Our revelations submissively. |
| 027:081 Shakir | : |
Nor can you be a guide to the blind out of their error; you cannot make to bear (any one) except those who believe in Our communications, so they submit. |
| 027:081 Sherali | : |
And thou canst not guide the blind out of their error. Thou canst make only those to hear who believe in Our Signs, so they submit. |
| 027:081 Yusufali | : |
Nor canst thou be a guide to the blind, (to prevent them) from straying: only those wilt thou get to listen who believe in Our Signs, and they will bow in Islam. |
Concepts/Themes Covered: أركان الإسلام > التوحيد > الكافرون > تشبيههم بالموتى والصم والبكم والعمي Pillars of Islam> Islamic> The Disbelievers> Their Resemblance with the Deceased, the Deaf, the Mute and the Blind أركان الإسلام > (محمد (صلى الله عليه وسلم > طبيعة رسالته Pillars of Islam> The Blessed Muhammad(PBUH)> His Mission's Nature(PBUH) أركان الإسلام > (محمد (صلى الله عليه وسلم > مآثره وخصائصه لله Pillars of Islam> The Blessed Muhammad(PBUH)> Memorable Qualities given to Him by Allah أركان الإسلام > الدين > المسلمون Pillars of Islam> Religion> The Moslems الإيمان > الأنبياء والرسل > مهمتهم في البلاغ Faith> The Prophets and the Messengers of Allah> Their Mission to Inform الدعوة إلى الله > وجوبها > مهمة الرسل The Call for Allah> Its Necessity> The Messengers' Mission
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


Date: Thu, 18 Dec 1997 18:42:07 GMT
Server: Apache/1.1.1
Content-type: text/html
Senior Quarters' Personal Services
Quality - True Quality...
Personal Care Assistance
- Assistance with the activities of daily living including: bathing,
personal hygiene, dressing, mobility and eating
- Supervision and assistance with self-administration of medications
Extended Care Assistance
- Professional aides trained to help seniors with declining cognitive
functioning
- Special activity areas designed specifically for these residents
- Especially high staff-to-resident ratio
- Activities geared specifically toward cognitive and behavioral problems
of Alzheimer's Disease
- A calm, non-stressful program provided in our specially-designed recreation
area
Nursing and Hospital Care
- Well-established relationships with the areas most respected providers
of quality medical care
- Referral and administration assistance with nursing facilities in the
immediate area
- Current referral list of area physicians from virtually every recognized
specialty
- Door-to-door transportation arranged to and from your personal physician's
or dentist's office
A Medical Examining Room
- Private exam room exclusively for the use of visiting physicians, podiatrists,
physical therapists and other health care professionals
- All visits are arranged by our full-time Medical Director
Security and Safety Provisions
- Security staff on duty at all hours
- Entire facility equipped with state-of-the-art safety and security
systems, including: exit door alarms, smoke detectors, fire sprinklers
and central station alarm
An Emergency Call System
- Immediate contact with the reception area at all hours by emergency
call cord in every room and bathroom, and a direct link intercom in the
living area of each apartment.
- Personnel trained in emergency procedures on premises 24 hours a day
Residental Services and Amenities
Included in Senior Quarters' Personal Services monthly rental
fee are:
- Housekeeping, Laundry and Linen Service
- Fully Furnished Apartments, including: kitchenette, color television,
emergency call system, plush wall-to-wall carpeting, color-coordinated
window treatments and bed linens, intercom system, individually-controlled
heat and air conditioning, ample closet and storage space, smoke detectors
and fire sprinklers, pre-wiring for personal telephone
- Luxurious Private Bathrooms with: shower stall with safety handrails,
spacious medicine cabinets, emergency call cord to summon assistance if
needed
- All utilities except telephone and cable TV


Curate Your Power Animals
entry #1 :
add another link
remove last entry
save links
nothing to display yet
clear all link(s)


Add the layer node and all of its children to the db
Is the lhs label a child of the rhs label
We are generally given a layer corresponding to an entire regulation. We need to split that layer up and store it per node within the regulation. If a reg has 100 nodes, but the layer only has 3 entries, it will still store 100 layer models – many may be empty


French-speaking part of Belgium, Namur and Villers Abbey
by Monika Suchoszek
The old wall of a medieval fortress made of red bricks and stone with the river slowly running in the background or maybe ruins of the abbey from XI century… these scenes for the unique pictures came to my mind while wondering about destination for the upcoming, sunny weekend. Photography is one of my biggest passions (besides hiking, running and travelling) and I always have some ideas for photos in mind before actually visiting the place :D I spend quite some time checking other travelling blogs and following travellers on instagram from where I get a lot of inspiration!
I just realized that it’s the first time I’m writing about Belgium and we live here for 2 years already! This summer we are travelling more locally because of travel restriction implemented by the government to reduce the spread of the virus. Luckily we bought a car in the spring this year (just two weeks before the lockdown when we both started to work from home) so now we are using it to make one-day trips, visiting also neighbouring countries (like the Netherlands if current situation allows to do it safely.
Namur was definitely one of the cities on my list to visit in Belgium after hearing about this place nice opinions. Located close enough from the place where we live to make spontaneous decision in the morning and go the same day. On the first photo below you can see Palais des Congrès (currently a congress center which was in the past a stock exchange), which we passed on the way to historical Citadel. The city center didn’t make a big impression on us but the best spots were still ahead of us :)
As were walking up the hill, a rather unique sculpture appeared next to the walls of the castle. We looked for any description or at least name of it but we couldn’t find any. Later, I have found that artwork of artist Jan Fabre is called ‘Searching for utopia’ and the copy of it can be found by the Belgium coast in Nieuwpoort. It’s really shiny and visible from the distance so for sure you will not miss it! This artist is also responsible for modern art installation called the Totem on Ladeuzeplein in Leuven. This one is also difficult to miss but for another reason, its uniqueness, as it shows huge Thai jewel beetle stuck on a 23 m high steel needle.
Beautiful panoramic view of the Meuse River on the way to the top of the hill, where you can get by car, touristic tram or simply on foot. As we were getting higher up the hill, we could admire the whole panorama of the river valley from another perspective. A week later we were cycling along the same river but in the region of Maastricht, the Netherlands. Btw, the area of Oud-Rekem is just paradise for cyclist!
Château de Namur (nowadays a hotel), which is surrounded by a nice garden, was the furthest point we reached during our walk (photo below). The whole area of Citadel is quite big, it took a few hours to explore it. There are some tunnels to walk by and we noticed it is possible to visit some underground corridors with the guide but I think now their offers are not available. There is also an old theater and the visitor center in the same building as the restaurant (it’s the final stop of the tram).
On the way back we stayed on the other side of the hill, overlooking the old part of the city where we parked our car. It was already past lunch time so high time to look for a restaurant. In Belgium many restaurants close between 2 pm and 5 pm, so we had to hurry up to make sure we found something to eat before that afternoon break.
Already on the highway leading to the area where Villers Abbey is located, we notice the signs advertising this place. It turned out to be very popular based on amount of people we found there! As soon as we got to the village Villers-la-Ville, we were shocked by the amount of cars parked just everywhere. We decided to first try and go to one of big, free parking but they all seemed to be fully packed. We were really lucky when a women walking through parking, offered her spot as she were leaving. We found the entrance pretty quickly and after showing our tickets on the phone, we could start exploring the ruins with the small map we got at the entrance.
According to the map, the photo above shows the refectory; the dining are were monks used to eat together but now there place is occupied by few goats and geese. You can clearly see that plants began taking over this abandoned abbey long time ago and only thanks to relentless efforts, plants didn’t completely destroy the construction of this place. Beautiful arched, columns, unusual shapes of windows, make an interesting setting for portrait or fashion photography. Indeed, there were a few models in a beautiful dresses with professional photographers taking their photos. Dresses in the vibrant colors look stunning against the muted tones in the background of stone and rock.
When we entered the ruins of the church, the huge nave (the central part) made a big impression on us. Just, look how small the people are in the photo. I did have to patiently wait for a moment with fewer people, don’t be misled by what you see on my photos … it was really crowded that day. But I really hate to have a random leg or head on the photos where architecture plays the major role :D
We passed the sacristy and abbey’s palace to finally end up in the gardens with fountains and colorful plants, although we could clearly notice the first signs of autumn. Pretty and quiet place but now very big. We immediately noticed big stairs leading to chapel and vineyard. What surprised us … there was a railway track just above the stairs so when you are traveling by train, you can catch a glimpse of the abbey. From the top of the hill we could see the ruins of the abbey from a distance, but only a small fragment was visible as the rest was covered by trees and passing trains.
As funny as it sounds, we couldn’t find the exit. There were many signs pointing left/right in different places of the complex but we felt like we are going from one to another without any known direction, after good 10 minutes of following the directions, we finally ended up in front of the stairs leading to the fields located on the other site of the street from where we could see the abbey from a distance. We had to pass visitors center, cafe, souvenir shop and another restaurant to get outside, really not easy! :D
Practical info:
- Citadelle de Namur - free entrance, few different ways to get up to the top, including one for people with strollers (entrance A), all of them leading to the restaurant and visitor center (with toilets inside). There are two parking areas on the top of the hill but with very limited number of spots so you need to be lucky to find a free one. Everyone was obligated to wear a mask in the whole area of the fortress but also in the city center. The signs explaining the rules applying in the city were visible very often on the streets, we notice them immediately after we started to walk towards city center. More info on the official website of the Citadelle
-
A restaurant in Namur that we can certainly recommend - very tasty Japanese Ramen Noodle soup including meat, bamboo shoot, nori, spring onions, broth of choice, egg, mushrooms and wheat noodles, which are also sometimes called chow mein noodles. Ramen restaurant Sanga
-
Car parking in Namur - we decided to park in the city center but not close to the Citadelle where it was diffucult to find free parking places, we parked on Rue des Bourgeois, 10 min. walking distance from the Citadelle, many spots available. It is paid parking zones from 9am until 5pm everyday of the week, except on Sundays and as were were there on Sunday, we didn’t have to purchase a ticket.
-
Entrance to Villers Abbey - 9 euro per person, tickets bought online on the day of the visit as we haven’t see the option to buy them the day before. It is not obligatory to wear a mask inside but many people have them anyway, maybe because it was quite crowded.
Subscribe via RSS


If enabled, when resizing columns via mouse drag and drop, will resize the cells of all column rows. Otherwise will only resize the headers until you stop dragging. The options.resizableColumns
option must be enabled for this to work.
This option is disabled by default because on large grids, the resizing of cells is choppy and slow. If you're working with smaller grids - you may want to enable this for a better user experience.
(boolean)
: Defaultfalse
.
{resizeCells: true}


Creating a Makefile project
This tutorial describes the process of creating a new C++ project that includes a makefile, and debugging the program.
You need to create a project to contain your source code and related files. A project has an associated builder that can incrementally compile source files as they are changed.
To create a project:
- Select File > New > Project.
When you create a new project, you are required to specify the project type. This project type will determine the toolchain, data, and tabs that the CDT uses/displays.
- Select the type of project to create. For this tutorial, expand the C/C++ folder and select C++ Project.
The C++ Project wizard opens. Click here to see an illustration.
By default, the CDT filters the Toolchain and Project types that currently display in those lists are based on the language support for the C++ Project wizard you selected for this tutorial.
- In the Project name field, type HelloWorld.
- Leave the Use Default Location option selected.
Next, you want to select the type of project to create. In the New CDT Project Wizard, you can choose from the following project types:- Executable - Provides an executable application. This project type folder contains three templates.
- Hello World C++ Example provides a simple C++ Hello World application with main().
- Hello World ANSI C Example provides a simple C Hello World application with main().
- Empty Project provides a single source project folder that contains no files.
After you select this template, the result is a project with only the meta-data files required for the project type. You are expected to provide source files for the project's target.
The makefile for the Executable project type is automatically created by the CDT.
- Shared Library - An executable module that is compiled and linked separately. When you create a project that uses a shared library (libxx.so), you define your shared library's project as a Project Reference for your application. For this project type, the CDT combines object files together and joins them so they're relocatable and can be shared by many processes. Shared libraries are named using the format libxx.so.version, where version is a number with a default of 1. The libxx.so file usually is a symbolic link to the latest version. The makefile for this project type is automatically created by the CDT.
- Static Library - A collection of object files that you can link into another application (libxx.a). The CDT combines object files (i.e. *.o) into an archive (*.a) that is directly linked into an executable. The makefile for this project type is automatically created by the CDT.
- Makefile Project - Creates an empty project without the meta-data files. This selection is useful for importing and modifying existing makefile-based projects; a new makefile is not created for this project type.
By default, the CDT filters the Toolchain and Project types that currently display in those lists based on the language support for the C++ Project wizard you selected for this tutorial.
- Executable - Provides an executable application. This project type folder contains three templates.
- From the Project types list, expand Makefile project and select Empty Project. This project lets you enter the source file and the makefile yourself.
- Select a required toolchain from the Toolchain list.
A toolchain is a set of tools (such as a compiler, linker, and assembler) intended to build your project. Additional tools, such as a debugger, can be associated with a toolchain.
There can be several toolchains available, depending on the compilers installed on your system. - Click Next.
- (Optional) On the Select Configurations page, Click Advanced Settings.
- Expand C/C++Build > Settings. Click the Binary Parsers tab.
Click here to see an illustration.
- In the Binary Parser list, select the error parser that is appropriate for your platform.
Other project settings can be modified here as well. The default selection is probably OK.
To ensure the accuracy of the C/C++ Projects view and the ability to successfully run and debug your programs, selecting the correct parser is important. After you select the correct parser for your development environment and build your project, you can view the components of the .o file in the C/C++ Projects view. You can also view the contents of the .o file in the C/C++ editor.
Click OK to close the Project Properties window.
- Expand C/C++Build > Settings. Click the Binary Parsers tab.
- Click Finish.
- If a message box prompts you to change perspectives, click Yes.
Your new project displays in the Project Explorer view. Your project is empty because you have not yet created files for your project. You may see an error since there is nothing to build yet for your project. You can now start writing the code for your HelloWorld program.
Tip: You can view and modify the properties of your HelloWorld project at any time by right-clicking on the project in the Project Explorer view and clicking Properties.
For more information about:
- Projects, see Workbench User Guide > Concepts > Workbench > Resources
- The workspace, see Workbench User Guide > Tasks > Upgrading Eclipse
CDT overview
CDT projects
Project file views


Hello, I have been performing professional web development work for over 4 years now, and I believe
everyone deserves access to the best technologies to run their business. Having lived in Huntingtown my entire life,
Oneiros is my way to help local businesses and entrepreneurs in Southern Maryland receive the web presence they deserve.
LinkedIn


| Type | Date | Home team |
Home points |
Away team |
Away points |
Week | Year |
|---|---|---|---|---|---|---|---|
| {{game.type}} | {{game.dayOfWeek}} {{game.date}} {{game.gameTime}} | {{game.homeTeam}} | {{game.homePoints}} | {{game.awayTeam}} | {{game.awayPoints}} | {{game.week}} | {{game.year}} |


A little bit about me. My name is Sarah Finck and I was born and raised in a small town known
as Peoria, IL which is about five and a half hours north of the KC area. After graduating highschool,
I attended college at Illinois State University in Normal, IL where I was granted a scholarship to
play softball. Four years later I graduated with a Bachelor's of science in Exercise Science and a
Minor in Business Administration. After graduating college, I was quickly ejected into the fitness
field, where I reside today. I recently decided to continue my education through the KU Coding
Bootcamp. I chose this career path because of the financial stability and my love for design. My goal
is to become a front end web developer.
Additional Info.
Some of my hobbies include: working out and taking my dog to Bar K. My dog is an 80 lb bernedoodle
(bernese mountain dog and poodle mix). She definitely keeps me busy! My all time favorite artist and
human is Beyonce, she has inspired me on so many levels. I also love to watch HGTV; I could watch
people flip houses for days. I hope you enjoyed this short blurb about me - follow me on LinkedIn and
GitHub to see my career path and stay up to date on my latest projects!


Jessica Biel spotted after Justin Timberlake caught cosying up with co-star
Jessica Biel was spotted in public for the first time since her husband Justin Timberlake was caught getting cosy with Palmer co-star Alisha Wainwright.
In the photos, the 37-year-old actress can be seen sporting a pair of sunnies and wearing a long coat, plain white tee and casual trousers.
But, peculiarly, she was holding a giant pillow, as well as a Transformers toy.
Perhaps their four-year-old son Silas had a sleepover?
Whatever it is, she’s looking unfazed and unbothered by recent rumours swirling around her husband’s antics last week.
(She’s also still wearing her wedding ring, if that’s anything to go by).
The rumours started after photos emerged of Justin and Alisha partying on a wild night out at The Absinthe House in New Orleans this weekend.
Advertisement Advertisement
Even more worryingly, Justin wasn’t wearing his wedding ring.
Alisha, 30, can be seen with her hand on 38-year-old Justin’s leg. While in another photo, the pair hold hands under the table.
Wearing a cap, Justin looks up at Alisha as she, at one stage, got up from her seat holding a bottle as she draped herself over a railing.
The pair were sitting on a balcony, surrounded by other party-goers, who all appeared to be having fun as they joked with Justin, who was in great spirits.
Justin also appeared in footage that showed him being helped up and dragged inside by a friend at the party.
Neither Justin or Jessica have spoken publicly about the incident.
Got a showbiz story?
If you've got a celebrity story, video or pictures get in touch with the Metro.co.uk entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


REVIEW: LONE STAR (1996)
Finally got around to see "Lone Star." It's hard to find a word to describe it since I'm still totally overwhelmed, awestruck.  It's a funny way to describe a movie, but my still-pounding heart can prove my reaction to it. It's perhaps the most complicated film I've seen since I saw "Chinatown" last year (on video of course).
The central character Sam Deeds (Christ Cooper), is the new sheriff in a small Texas town. Early on we are told that his deceased father, Buddy Deeds (Matthew McConnaghey), was a legend in this town carrying the same badget 40 years ago. Yet somehow Sam's resentment to him and certain rumors about Buddy's old deeds make us wonder. This suspicion is backed by a skeleton discovered in the deserted area outside the town that belongs to the town's sheriff before Buddy, the much feared and hated Charley Wade (Kris Kristofferson), an old fashioned small-town sheriff who's done every bad thing you've heard of in western movies, from squeezing money from local business (legal or otherwise) to killing whoever he feels like. Haunted by his own emotional baggage, Sam digs into the whole murder business, trying to tear down the idol worshiped by the town, and the deeper he goes, the more skeletons come to see the daylight.
In the mean time, we get to know a couple of other families in town, including Sam's high school lover Pilar (Elizabeth Pena), a widowed school teacher, and her mother, plus Otis Payne, an old black bar owner who may have witnessed the murder 40 years ago, and Colonal Payne, Otis' son who has his own problems with his father. And that's just the main players in this movie. It is impossible to recap the plot in a couple of paragraphs so I might as well give up trying. It's simply dazzling to create such intricate and interwound storyline within a seemingly "usual" plot of a murder mystery. What's more mind-boggling, however, is the deep and complex emotional relationship between the characters, which is presented clearly, delicately, smoothly and subtly. There are a handful of parallel storylines connected with each other by the long-passed murder, linking both the past and the present.
And just when you think it can't get any more complicated, the writer/director/producer John Sayles stuffs in more social commentary about racism and racial division, corrupt politics, people's tendency to make legends out of their needs, the Mexican heritage of Texas, etc. etc. The amazing thing is that none of these topics feel forced and detatched from the story, because the core is still about the characters and how the past sins of their fathers affect them. It's about one's past that cannot be shaken off easily, which in turn echoes the history and present of America. The mirroring of personal lives and the big society is one of the heavy themes of this picture. It is also the focus on the characters that keeps our attention and makes the film successful.
With half a dozen major characters and 15-20 minor ones, it's simply amazing that almost none of them feel unrealistic (almost, with the exception of Frances MacDormand's character, Sam's divorced wife). The emotions are real and believable in a cliched setup. It proves my theory that there is more drama in reality if you know how to put them together. What's satisfying is that the writer presents the discussion, but does not cheapen it by trying to find an easy way out like so many other films tend to do. So you can't make a disillusioned girl give up drug and love life with one heart-to-heart talk. That's life. It's amazing to see John Sayles resists an easy solution from big social problem down to the smallest personal conflict.
The actors are a blast too. My favorite performance is Joe Morton, playing a successful black colonal facing his troubled feeling to his father again after years of bitterness. He handles it with such delicacy and depth that it may well be the best performance from last year that I have seen. Everyone else is all the way up there too. The romantic element between two tired adults who love each other is natural and persuasive. Both Cooper and Pena gave convincing performances. Plus most of the supporting cast.
With so many characters and conflicts, some of them are bound to be weaker than others, but there are still plenty of pearls in this pile of treature. The Mexican illegal immigrants issue could be handled better. Some dialogues are a little too politically oriented and simplistic, less subtle than others, but most of the emotions and feelings are genuine and heart-felt. John Sayles is a typical American (but not Hollywood) filmmaker. He goes for the big, big issues, big story, big emotional rides. It's miracle that the screenplay feels close to real life all the way through. The style of "Lone Star" is more or less in the root of traditional story-telling. The ending, however, is not that satisfying. I personally had problems with the big secret revealed in the end, which I thought the film could have done without. (Not that it can't be done. I read a Sam Shepherd play years ago with same theme. It's just a little too much here for this movie.)
I had much expectation for "Lone Star," and it still surprised me. It's not perfect, but anyone who can take care of so many things at the same time is more unbelievable than perfection. It doesn't feel terribly "personal" to me, but the complexity of the whole production (from the script to direction to the performances, from the certral characters to the guy with only one line) surpasses anything I can think of presently. How did they do that? Grade: A.
jun
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Software authored by Guangchuang Yu
R/Bioconductor packages
I have developed 10 packages on CRAN
and 10 on Bioconductor
. For CRAN
packages, you can use install.packages()
to install them directly and for Bioconductor
packages, you need to follow the guide on package homepage by using biocLite()
to install.
If you are interesting, please visit package homepage to learn more.
- CRAN
- badger: Badge for R Package
- dlstats: Download Stats of R Packages
- emojifont: Emoji and Font Awesome in Graphics
- ggimage: Use Image in ‘ggplot2’
- ggplotify: Convert Plot to ‘grob’ or ‘ggplot’ Object
- meme: Create Meme
- rvcheck: R/Package Version Check
- scatterpie: Scatter Pie Plot
- shadowtext: Shadow Text Grob and Layer
- tidytree: A Tidy Tool for Phylogenetic Tree Data Manipulation
- Bioconductor
- ChIPseeker: ChIPseeker for ChIP peak Annotation, Comparison, and Visualization
- clusterProfiler: statistical analysis and visualization of functional profiles for genes and gene clusters
- DOSE: Disease Ontology Semantic and Enrichment analysis
- enrichplot: Visualization of Functional Enrichment Result
- ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data
- GOSemSim: GO-terms Semantic Similarity Measures
- meshes: MeSH Enrichment and Semantic analyses
- ReactomePA: Reactome Pathway Analysis
- seqcombo: Visualization Tool for Sequence Recombination and Reassortment
- treeio: Base Classes and Functions for Phylogenetic Tree Input and Output
JAVA
- TIPars: Taxa Insertion by Parsimony
Contributions to open source libraries
- basicTrendline: Add Trendline and Confidence Interval of Basic Regression Models to Plot
- cowsay: Messages, Warnings, Strings with Ascii Animals
- kableExtra: Construct Complex Table with ‘kable’ and Pipe Syntax
- microbiomeViz: Visualizing Microbiome Data
- MSnbase: Base Functions and Classes for Mass Spectrometry and Proteomics
- scholar: Analyse Citation Data from Google Scholar
MISC
- unofficial BioEdit for OSX: Biological sequence alignment editor
- SciHub苹果桌面版


All VTP packets contain these fields in the header:
Most VTP packets contain the configuration revision number of the sender. This is used to determine if the received information is more recent than the current version.
By default, summary advertisements are sent every 5 minutes. The summary advertisement contains the VTP domain name and the current configuration revision number. If the VTP domain matches the switch’s configured VTP domain, and the configuration revision number is higher than its own revision, the switch will send an advertisement request. Otherwise, it ignores the packet.
A subset advertisement will follow a summary advertisement - it is the message that actually contains a list (or a subset of a list) of the VLANs being advertised.
A switch will send an advertisement request in these situations:


Machintosh HD — bash — 1000x
595
iMac:~ user$ ping sysadminsyndicate.com
PING sysadminsyndicate.com (<IP_ADDRESS>) 32 bytes
Request timeout for icmp_sec 0 time=306ms TTL=52
Request timeout for icmp_sec 1 time=315ms TTL=52
Request timeout for icmp_sec 2 time=324ms TTL=52
Request timeout for icmp_sec 4 time=328ms TTL=52
^C
--- sysadminsyndicate.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss time 1273
$


Filmography:
Watch, dicuss, rate his movies on mubi.
Spooky fact:
In his youth, Andrei Tarkovsky consulted a clairvoyant so he could be in contact with the spirit of Boris Pasternak who told him "you will make seven films", to which Andrei replied "only seven?" and Boris to add "but good ones". The first shot of Tarkovsky's first film shows a child standing next to a young tree; the last shot of Tarkovsky's seventh's film shows a kid lying on the ground at the bottom of a dead tree. He died shortly after its completion, he didn't know he was sick at the time of the shooting.


Derek Eder
@derekeder
Cook County Board of Commissioners will be voting on opening up Cook County GIS data. Watch live: http://cook-county.granicus.com/MediaPlayer.php?view_id=3&event_id=187 see pg 38 #opendata
12/4/2013, 11:06:45 AM
Favs: 0
Retweets: 3
link


Installing front end packages using Bower
Use bower to install front end packages such as jQuery, Underscore, Backbone and many others. Learn more about Bower and discover the benefits of using a package manager for the web. Find more Bower components here or create your own.
$ bower install backbone
Finatra's default bower.json
{ "name": "Finatra Project", "version": "0.0.1", "license": "MIT", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap" : "twbs/bootstrap" } }
Pre-configured .bowerrc
{ "directory": "./src/main/resources/public/components" }
Bootstrap and jQuery at the ready
src |-- main |-- resources |-- public |-- components |-- bootstrap |-- jquery


Full-featured IDE
Ionic Studio is a full code editor with TypeScript support, autocompletion, debugging and more. A single install delivers nearly every dependency, so you can focus on development instead.
-
UI Component Library
Drag & drop 100+ pre-built Ionic UI components directly into your project’s code. Then modify their properties live.
-
No Docs Required
With Ionic’s components at your fingertips, no need to dig through pages of documentation just to learn Ionic.
-
Secure Local Editor
Studio’s secure, local editor works off the file system and plays nicely with other tools, and with new or existing projects.
Visual Design Mode
Drag and drop components directly into your app, which automatically adds logic and code as you build. Move seamlessly between design and code to create apps more visually with live previews.
-
Drag & Drop Components
Drag & drop 100+ pre-built Ionic UI components directly into your project’s code. Then modify their properties live.
-
Theme Editing
With Ionic’s components at your fingertips, no need to dig through pages of documentation just to learn Ionic.
-
Properties Editor
Studio’s secure, local editor works off the file system and plays nicely with other tools, and with new or existing projects.
Live Preview. Native & Web.
Watch your app come to life in real-time, as you build it out. Studio lets you preview your app live via the web and physical devices. You can also natively run your project as an iOS or Android app with the click of a button.
-
Drag & Drop Components
Drag & drop 100+ pre-built Ionic UI components directly into your project’s code. Then modify their properties live.
-
Theme Editing
With Ionic’s components at your fingertips, no need to dig through pages of documentation just to learn Ionic.
-
Properties Editor
Studio’s secure, local editor works off the file system and plays nicely with other tools, and with new or existing projects.


By Gong Zijun, Kwok Ka Ching, Pan Yichao,
Wong Sze Wing, Wong Ting Yan, Wong Yat Yi
The social movement against the draft amendment to the Fugitive Offenders Ordinance (hereinafter referred to as the "Anti-Extradiction Bill Movement") began in June and has lasted for more than five months. Demonstrations have become more and more fierce, and many times they evolve into conflicts between police and civilians. Social workers have been at the forefront and mediate between the police and demonstrators.
Many social work students see the contributions of front-line social workers. Therefore, they set up a street stations to cheer for Hong Kong people and to counsel people with negative emotions. Some quasi-social workers said that they also felt powerless in the "Anti-Extradiction Bill Movement". They feel that they cannot help others with the knowledge they absorbed from lessons. Their feelings of loss are difficult to resolve and doubt themselves whether they should become social workers in the future.


Chapel of the Flowers oers award-winning wedding photography options that are sure to capture every special moment of your big day on the world-famous Las Vegas Strip! Our photography packages oer several options that are sure to fit any budget.
Couples are consistently impressed with our world-class customer service, and our ability to plan the entire wedding ceremony, orchestrate flowers, reception venues, tuxedo and gown rentals, provide award-winning photography, and everything else you could want to create a flawless Las Vegas wedding experience
At Chapel of the Flowers, our new state-of-the art limos are sure to oer the special touch needed for your Vegas wedding while ensuring you and your guests are able to travel in style from your hotel lobby to our beautiful wedding grounds.


COVID-19 Live Tracker
HOME
(current)
PREVENTION
(current)
UPDATES
(current)
ABOUT
(current)
Top
Let's Stay Safe & Break The Chain !
Coronavirus Updates (Worldwide)
Confirmed
Recovered
Deaths
The Important Prevention Steps Against Coronavirus
Wash your hands regularly for 20 seconds, with soap and water or an alcohol based hand rub.
 Also, Use Masks.
Avoid close contact (1 meter or 3 feet) with people who are unwell
Stay at home as much as possible and break the chain. Stay isolated from others if you feel unwell to avoid the spread.
Stay informed and aware by watching news & follow the recommended practices.
If you have cough, fever, difficulty in breathing then seek medical care as early as possible.
Countrywise Data of COVID-19
Search
S.No
COUNTRY
CONFIRMED
ACTIVE
RECOVERED
Repository :
API used :
Download
Aarogya Setu
App
Download
Download
Made with
by
Shubham Jha


Key Word(s): NLP, Embedding, tokenize, CNN, Convolutional Neural Network
CS109B Data Science 2: Advanced Topics in Data Science
Lecture 9: NLP example with CNN¶
Harvard University
Spring 2019
Instructors: Pavlos Protopapas and Mark Glickman
#RUN THIS CELL
import requests
from IPython.core.display import HTML
styles = requests.get("https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/cs109.css").text
HTML(styles)
In this example, we will try to implement a CNN for text.
We will use the task of IMDB movie review classification. Response variable is positive/negative review.
A sentence can be thought of as a sequence of words which have semantic connections across time.
By semantic connection, we mean that the words that occur earlier in the sentence influence the sentence's structure and meaning in the latter part of the sentence.
Note: There are also semantic connections backwards in a sentence (we will revisit this idea when we do RNNs from both directions and combine their outputs which we will see in the next few lectures).
import numpy
from keras.datasets import imdb
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM, SimpleRNN
from keras.layers.embeddings import Embedding
from keras.layers import Flatten
from keras.preprocessing import sequence
from keras.layers.convolutional import Conv1D
from keras.layers.convolutional import MaxPooling1D
from keras.layers.embeddings import Embedding
import numpy as np
# fix random seed for reproducibility
numpy.random.seed(1)
SEEDING - Important thing to do in many machine learning tasks which involve stochastic sampling (where random numbers are generated for different samples) is to do seeding so that the results are fairly reproducible.
WHY SEEDING ? Most random number generators in computers are pseudo-random number generators i.e. they generate random numbers starting from a seed, but internally have a deterministic formula to calculate the next random number it generates and thus, if you fix your seed, the set of random numbers produced are the same in every run.
STEP 1 : Load and visualize the data¶
# We want to have a finite vocabulary (9,999 most frequent words, one for everything else)
vocabulary_size = 10000
#We also want to have a finite length of reviews and not have to process really long sentences.
# Anything longer will be chopped!
max_review_length = 500
For practical data science applications, we need to convert text into tokens since the machine understands only numbers and not really English words like humans can. As a simple example of tokenization, we can see a small example.
Assume we have 5 sentences. This is how we tokenize them into numbers once we create a dictionary.
- I have books - [1, 4, 7]
- Interesting books are useful [10,2,9,8]
- I have computers [1,4,6]
- Computers are interesting and useful [6,9,11,10,8]
- Books and computers are both valuable. [7,10,2,9,13,12]
Create tokens for vocabulary based on frequency of occurrence. Hence, we assign the following tokens
I-1, books-2, computers-3, have-4, are-5, computers-6,books-7, useful-8, are-9, and-10,interesting-11, valuable-12, both-13
Thankfully, in our dataset it is internally handled and each sentence is represented in such tokenized form.
(X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=vocabulary_size)
print('Number of reviews', len(X_train))
print('Length of first and fifth review before padding', len(X_train[0]) ,len(X_train[4]))
print('First review', X_train[0])
print('First label', y_train[0])
Pad sequences in order to ensure that all inputs have same sentence length and dimensions.
DISCUSSION : Why are we padding here?
X_train = sequence.pad_sequences(X_train, maxlen=max_review_length)
X_test = sequence.pad_sequences(X_test, maxlen=max_review_length)
print('Length of first and fifth review after padding', len(X_train[0]) ,len(X_train[4]))
Is Accuracy the right metric to look at ?¶
Discuss : In what cases is accuracy a good metric to measure classification models ?
What other metrics are useful incase accuracy proves to be incompetent metric for our dataset ? https://towardsdatascience.com/understanding-data-science-classification-metrics-in-scikit-learn-in-python-3bc336865019
from collections import Counter
counts = dict(Counter(y_train))
print('Number of zeroes : ', counts[0], ' and Number of ones : ', counts[1])
MODEL 1(a) : FEEDFORWARD NETWORKS WITHOUT EMBEDDINGS¶
Let us build a single layer feedforward net with 250 nodes.
GOAL : Calculate the number of parameters involved in this network and implement a feedforward net to do classification.
model = Sequential()
model.add(Dense(250, activation='relu',input_dim=max_review_length))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
print(model.summary())
model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=3, batch_size=128, verbose=2)
# Final evaluation of the model
scores = model.evaluate(X_test, y_test, verbose=0)
print("Accuracy: %.2f%%" % (scores[1]*100))
Any idea why the performance is terrible ?¶
Hint : Tokenization.
Obvious Workaround : One-Hot Encodings
EMBEDDINGS - Sparse to Dense Transformations¶
We use embeddings to reduce dimensions of our data since the tokens we assign based on our word frequency are discrete and do not have a continuous structure.
What are embeddings ?¶
Embeddings are functional transformations from a sparse discrete vector representation of text (either as tokens or as one-hot encodings) into a dense vector representation of a fixed size(usually of much lower dimensions than the vocabulary length of the text). The dense representations allow the neural network to generalize better.
Here we are training our own embedding while training our neural network. To transfer "knowledge" from other sources, in more complicated projects we can also use pre-trained embeddings such as word-2-vec, GloVE, Fastext etc. https://nlpforhackers.io/word-embeddings/
Example Embeddings Transformation¶
Let us first understand how Keras embedding layer works through a dummy example to see how the dimensions are transformed. In this example, each input is mapped to a 64 dimensional vector (via the embedding layer).
EXERCISE : Manually calculate the number of parameters needed in the embedding layer before executing the code.
model = Sequential()
#input - Number of categorical inputs, embedding dimension, input length.
model.add(Embedding(1000, 64, input_length=10))
print(model.summary())
# the model will take as input an integer matrix of size (batch, input_length).
# the largest integer (i.e. word index) in the input should be
# no larger than 999 (vocabulary size).
# now model.output_shape == (None, 10, 64), where None is the batch dimension.
input_array = np.random.randint(1000, size=(32, 10))
print("Shape of input : ", input_array.shape)
model.compile('rmsprop', 'mse')
output_array = model.predict(input_array)
assert output_array.shape == (32, 10, 64)
print(input_array[0])
print(output_array[0].shape)
MODEL 1(b) : FEEDFORWARD NETWORKS WITH EMBEDDINGS¶
EXERCISE : Implement the feedforward net combining the embedding layer and the feedforward layer(one layer, 250 nodes) without looking at cells below. Manually calculate the number of parameters needed in the feedforward network before executing the code.
embedding_dim = 100
model = Sequential()
model.add(Embedding(vocabulary_size, embedding_dim, input_length=max_review_length))
model.add(Flatten())
model.add(Dense(250, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
print(model.summary())
# Fit the model
model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=2, batch_size=128, verbose=2)
# Final evaluation of the model
scores = model.evaluate(X_test, y_test, verbose=0)
print("Accuracy: %.2f%%" % (scores[1]*100))
MODEL 2 : Convolutional Nets¶
Text can be thought of as 1-dimensional sequence and we can apply 1-D Convolutions over a set of words. Let us walk through convolutions on text data with this blog.
EXERCISE : Manually calculate the number of parameters needed in the feedforward network before executing the code.
# create the model
model = Sequential()
model.add(Embedding(vocabulary_size, embedding_dim, input_length=max_review_length))
model.add(Conv1D(filters=embedding_dim, kernel_size=3, padding='same', activation='relu'))
model.add(MaxPooling1D(pool_size=2))
model.add(Flatten())
model.add(Dense(250, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
print(model.summary())
# Fit the model
model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=2, batch_size=128, verbose=2)
# Final evaluation of the model
scores = model.evaluate(X_test, y_test, verbose=0)
print("Accuracy: %.2f%%" % (scores[1]*100))
EXERCISE¶
Try other CNNs with
- Different kernel sizes
- Different pooling operations(AveragePooling1D)
DISCUSSION : What does max and average pooling mean in terms of processing text sequences ?


Have Some Fun With The Following Giphy!
Teacher
Nurse
Doctors
Developers
Plumbers
Farmers
Belmans
Chefs
Artist
Lawyers
Architects
Runners
Add a Professional