- getAlbum() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
get the current media's album
- getAlbumName() - Method in class com.musicplayer.scanner.FolderScanner
-
return the last folder name (without /) of the path to use as album name.
- getAlbumName() - Method in interface com.musicplayer.scanner.Scanner
-
get the name of the album that will be played
(is ideally then replaced by the album gotten from the player)
- getAllDirectories() - Method in class com.musicplayer.scanner.FolderScanner
-
get all the _subdirectories_ of the directory
- getAllFiles() - Method in class com.musicplayer.scanner.FolderScanner
-
get all the _files_ in a directory
- getAllFormatFiles(String[]) - Method in class com.musicplayer.scanner.FolderScanner
-
get all the _files_ matching a certain extension
- getAllImageFiles() - Method in class com.musicplayer.scanner.FolderScanner
-
uses a predefined format to get all image files in the scan
- getAllImageFiles() - Method in interface com.musicplayer.scanner.Scanner
-
get all the images associated with the content
- getAllMusicFiles() - Method in class com.musicplayer.scanner.FolderScanner
-
uses a predefined format array to get all music files in the scan
- getAllMusicFiles() - Method in interface com.musicplayer.scanner.Scanner
-
get all the music files to play
- getArtist() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
get the current media's artist
- getCoverArt() - Method in class com.musicplayer.scanner.FolderScanner
-
uses a regex to get all files that should be cover art in the scan
- getCoverArt() - Method in interface com.musicplayer.scanner.Scanner
-
get the cover art to display
- getDuration() - Method in interface com.musicplayer.player.Player
-
Get the duration of the current track (long, in milliseconds)
- getDuration() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- getDuration() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- getDuration() - Method in class com.musicplayer.player.VLCJListPlayer
-
- getDuration() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- getDuration() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
get the duration of the song
- getEmbeddedCover() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
Get the embedded art URI provided by Libvlc
- getEmbeddedCoverUri() - Method in interface com.musicplayer.player.Player
-
get an url to the embedded artwork
(for the VLCJ player, this is a path to a cached copy of the artwork)
- getEmbeddedCoverUri() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- getEmbeddedCoverUri() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- getEmbeddedCoverUri() - Method in class com.musicplayer.player.VLCJListPlayer
-
- getEmbeddedCoverUri() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- getExtension(String) - Static method in class com.musicplayer.misc.Helper
-
Extract the file extension from a given path.
- getFinishedAction() - Method in class com.musicplayer.player.VLCJMediaPlayerEventAdapter
-
- getNewPosition() - Method in class com.musicplayer.gui.swing.Seekbar
-
get the seeked position
- getPath() - Method in class com.musicplayer.scanner.FolderScanner
-
get the path that was passed to the ctor, debugging method
- getPosition() - Method in class com.musicplayer.gui.swing.Seekbar
-
get the sekbar's position
- getPosition() - Method in interface com.musicplayer.player.Player
-
Get the playback position
- getPosition() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- getPosition() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- getPosition() - Method in class com.musicplayer.player.VLCJListPlayer
-
- getPosition() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- getPosition() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
get the current playback position
- getPositionUpdatedAction() - Method in class com.musicplayer.player.VLCJMediaPlayerEventAdapter
-
- getScan() - Method in class com.musicplayer.scanner.FolderScanner
-
return the results of the scan, debugging method
- getSeekbarPosition() - Method in interface com.musicplayer.gui.GUI
-
get the seekbar position
- getSeekbarPosition() - Method in class com.musicplayer.gui.swing.SwingGUI
-
- getSeekPosition() - Method in interface com.musicplayer.gui.GUI
-
get the seeking position
- getSeekPosition() - Method in class com.musicplayer.gui.swing.SwingGUI
-
- getTitle() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
return the current media's title
- getVolume() - Method in interface com.musicplayer.player.Player
-
*Get the volume level
- getVolume() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- getVolume() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- getVolume() - Method in class com.musicplayer.player.VLCJListPlayer
-
- getVolume() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- getVolumeIncrement() - Method in interface com.musicplayer.player.Player
-
Get the increment of the volume
- getVolumeIncrement() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- getVolumeIncrement() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- getVolumeIncrement() - Method in class com.musicplayer.player.VLCJListPlayer
-
- getVolumeIncrement() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- GUI - Interface in com.musicplayer.gui
-
Defines the minimum framework to implement a player to be a drop-in replacement in Main.
- GUISwingPanel - Class in com.musicplayer.gui.swing
-
JPanel responsible for the scaled display of the cover art
- GUISwingPanel() - Constructor for class com.musicplayer.gui.swing.GUISwingPanel
-
- Scanner - Interface in com.musicplayer.scanner
-
Defines the minimum framework to implement a scanner to be a drop-in replacement in Main.
- Seekbar - Class in com.musicplayer.gui.swing
-
Seekbar component for the Swing GUI
- Seekbar() - Constructor for class com.musicplayer.gui.swing.Seekbar
-
- SEP - Static variable in class com.musicplayer.misc.Helper
-
- setAlbumArt(String) - Method in interface com.musicplayer.gui.GUI
-
set the filename to the image to display in the album art field
- setAlbumArt(URI) - Method in interface com.musicplayer.gui.GUI
-
set the album art with an URI
- setAlbumArt(String) - Method in class com.musicplayer.gui.swing.SwingGUI
-
Give the path of the image to be displayed as cover
- setAlbumArt(URI) - Method in class com.musicplayer.gui.swing.SwingGUI
-
- setClicked(Runnable) - Method in class com.musicplayer.gui.swing.Button
-
Select the action to be run when the button is clicked
- setFilename(String) - Method in class com.musicplayer.gui.swing.GUISwingPanel
-
Set the filename of the image to render as cover art
- setFinishedAction(Runnable) - Method in class com.musicplayer.player.VLCJMediaPlayerEventAdapter
-
- setFinishedAction(Runnable) - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
set what to run once the song finishes
- setGainedFocusAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
set what to run when the window regains focus
useful to update a label that only gets updated once per song, for example
- setGainedFocusAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
- setNextAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
these are used to bind the GUI with the Player
This way, the GUI and the Player are completely agnostic from one another
set what runs when the "next" action is triggered
- setNextAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
select what happens when the "next" button is clicked
(for example, lambda with player.next())
- setPauseAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
set what runs when the "play/pause" action is triggered
- setPauseAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
select what happens when the "pause" button is clicked
(for example, lambda with player.next())
- setPosition(float) - Method in class com.musicplayer.gui.swing.Seekbar
-
Set the displayed seekbar's position
- setPosition(float) - Method in interface com.musicplayer.player.Player
-
Set the playback position
- setPosition(float) - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- setPosition(float) - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- setPosition(float) - Method in class com.musicplayer.player.VLCJListPlayer
-
- setPosition(float) - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- setPosition(float) - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
set the playback position
- setPositionChanged(Runnable) - Method in class com.musicplayer.gui.swing.Seekbar
-
Set what happens when the user changes the position
- setPositionUpdatedAction(Runnable) - Method in interface com.musicplayer.player.Player
-
What runs when the position is updated?
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.VLCJListPlayer
-
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.VLCJMediaPlayerEventAdapter
-
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- setPositionUpdatedAction(Runnable) - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
what to run when the position updates
- setPreviousAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
set what runs when the "previous" action is triggered
- setPreviousAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
select what happens when the "previous" button is clicked
(for example, lambda with player.next())
- setSeekbarMovedAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
what happens when the seekbar is moved by the user
- setSeekbarMovedAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
- setSeekbarPosition(float) - Method in interface com.musicplayer.gui.GUI
-
set the seekbar position
- setSeekbarPosition(float) - Method in class com.musicplayer.gui.swing.SwingGUI
-
- setTrackLabel(String) - Method in interface com.musicplayer.gui.GUI
-
set the information to display about the track
- setTrackLabel(String) - Method in class com.musicplayer.gui.swing.SwingGUI
-
Set the text to display for track information (above album art)
- setUpdateMediaAction(Runnable) - Method in interface com.musicplayer.player.Player
-
Updates the function that is executed when the metadata for the new playing media becomes available
- setUpdateMediaAction(Runnable) - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- setUpdateMediaAction(Runnable) - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- setUpdateMediaAction(Runnable) - Method in class com.musicplayer.player.VLCJListPlayer
-
- setUpdateMediaAction(Runnable) - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- setVDownAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
set what runs when the "volume down" action is triggered
- setVDownAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
select what happens when the "volume down" button is clicked
(for example, lambda with player.next())
- setVolume(int) - Method in interface com.musicplayer.player.Player
-
Set the volume to a precise int, between the minimum and maximum set in the class constants.
- setVolume(int) - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- setVolume(int) - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- setVolume(int) - Method in class com.musicplayer.player.VLCJListPlayer
-
- setVolume(int) - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- setVolume(int) - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
set the volume precisely
- setVolumeIncrement(int) - Method in interface com.musicplayer.player.Player
-
Set the amount by which the volume is modified
Affects volumeUp() and volumeDown()
- setVolumeIncrement(int) - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- setVolumeIncrement(int) - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- setVolumeIncrement(int) - Method in class com.musicplayer.player.VLCJListPlayer
-
- setVolumeIncrement(int) - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- setVUpAction(Runnable) - Method in interface com.musicplayer.gui.GUI
-
set what runs when the "volume up" action is triggered
- setVUpAction(Runnable) - Method in class com.musicplayer.gui.swing.SwingGUI
-
select what happens when the "volume up" button is clicked
(for example, lambda with player.next())
- setWindowName(String) - Method in interface com.musicplayer.gui.GUI
-
set the name of the window
- setWindowName(String) - Method in class com.musicplayer.gui.swing.SwingGUI
-
set the title of the window
- ShortcutBinding - Class in com.musicplayer.keyboard
-
Key binding to use shortcuts
- ShortcutBinding(JFrame) - Constructor for class com.musicplayer.keyboard.ShortcutBinding
-
Get jframe content pane inputMap (the JComponent.WHEN_IN_FOCUSED_WINDOW) and actionMap
- ShortcutBinding(JPanel) - Constructor for class com.musicplayer.keyboard.ShortcutBinding
-
Get jpanel content pane inputMap (the JComponent.WHEN_IN_FOCUSED_WINDOW) and actionMap
- ShortcutBinding(JFrame, int) - Constructor for class com.musicplayer.keyboard.ShortcutBinding
-
Get jframe content pane inputMap (the inputMapType) and actionMap
- ShortcutBinding(JPanel, int) - Constructor for class com.musicplayer.keyboard.ShortcutBinding
-
Get jpanel content pane inputMap (the inputMapType) and actionMap
- showWindow() - Method in interface com.musicplayer.gui.GUI
-
make the window visible to the user
- showWindow() - Method in class com.musicplayer.gui.swing.SwingGUI
-
Show the window
- SingleAlbumLogic - Class in com.musicplayer.logic
-
Scan a folder, build the GUI and start playback
takes one folder as command line argument
- SingleAlbumLogic(String[]) - Constructor for class com.musicplayer.logic.SingleAlbumLogic
-
Constructor: create and initialize all the required objects
- start() - Method in interface com.musicplayer.logic.Logic
-
starts the GUI and Playback
- start() - Method in class com.musicplayer.logic.SingleAlbumLogic
-
- stop() - Method in interface com.musicplayer.player.Player
-
- stop() - Method in class com.musicplayer.player.VLCJBufferedPlayer
-
Deprecated.
- stop() - Method in class com.musicplayer.player.VLCJDuoPlayer
-
- stop() - Method in class com.musicplayer.player.VLCJListPlayer
-
Stop playback.
- stop() - Method in class com.musicplayer.player.vlcjsingle.VLCJSinglePlayer
-
- stop() - Method in class com.musicplayer.player.vlcjsingle.VLCJSingleTrackPlayer
-
stop playback
- SwingGUI - Class in com.musicplayer.gui.swing
-
Create a Swing GUI for the player
- SwingGUI(String) - Constructor for class com.musicplayer.gui.swing.SwingGUI
-
Initialize the window


You are the puzzle setter this round. Monitor the other players below.
{{setPuzzleMessage}}
{{position}}
{{letter}}
{{gameDetails.stateForPlayer(game, md5, 'category')}}
{{gameDetails.stateForPlayer(game, md5, 'wordPhrase')}}
{{gameDetails.stateForPlayer(game, md5, 'workingWordPhrase')}}
Moves: {{gameDetails.stateForPlayer(game, md5, 'moveCount')}}, Left: {{gameDetails.stateForPlayer(game, md5, 'blanksRemaining')}}, Til Hung: {{gameDetails.stateForPlayer(game, md5, 'penaltiesRemaining')}}
Round Score: {{gameDetails.gameScoreForPlayer(game, md5)}}, Total Score: {{gameDetails.runningScoreForPlayer(game, md5)}}
| Created: | {{created |date:'short'}} | Last Change: | {{lastUpdate |date:'short'}} | Completed: | {{completed |date:'short'}} | Declined: | {{declined |date:'short'}} | Next Round Started: | {{rematched |date:'short'}} |


Protesters block entrance to Iraq's Umm Qasr port
by ReutersProtesters have once again blocked the entrance to Iraq's Umm Qasr commodities port near Basra, preventing employees and tankers from entering and bringing operations down by 50%, two port sources told Reuters on Monday.
If the blockage goes on until the afternoon, operations will come to a complete halt, the sources said. The port was previously blocked from Oct 29 to Nov 9 with a brief resumption of operations between Nov 7-9.
Umm Qasr is Iraq's main Gulf port. It receives imports of grain, vegetable oils and sugar shipments that feed a country largely dependent on imported food.
The blockage cost the country more than $6 billion during just the first week of the closure, a government spokesman said at the time.
More than 300 people have been killed since the start of mass unrest in Baghdad and southern Iraq in early October, the largest demonstrations since the fall of Saddam Hussein in 2003.
Protesters are demanding the overthrow of a political class seen as corrupt and beholden to foreign interests. They have turned to civil disobedience tactics like strikes, disrupting traffic, and blocking ports or oil facilities.


Calibrates eyetracking from a raw video. Estimates a TPS warping for
the points.
|
|
__init__(self,
calibrationVideoFile,
calibrationBeginTime=None,
calibrationPositions=None,
calibrationOrder=None,
calibrationDuration=2,
calibrationDelay=2,
method=<PupilFindingMethod.Templates: 1>)
Constructor |
source code
|
|
|
EyetrackingCalibrator
|
Copy(self,
duration=None,
delay=None)
Make a copy of this object, but does not copy the pupil finder's
frames so we save space. |
source code
|
|
|
|
FindPupils(self,
window=None,
blur=5,
dp=1,
minDistance=600,
param1=None,
param2=None,
minRadius=10,
maxRadius=18,
windowSize=15,
outlierThresholds=None,
filterPupilSize=True,
surfaceBlur=None,
nThreads=None)
Finds pupil traces |
source code
|
|
|
|
EstimateCalibrationPointPositions(self,
beginTime=None,
method=<__builtin__.function object>,
startDelay=0.166666666667,
endSkip=0.0,
duration=None,
filtered=True,
verbose=True)
Estimates the pupil positions corresponding to each calibration point |
source code
|
|
|
|
Fit(self,
smoothnesses=array([-1.00000000e-03, 1.00020202e-01, 2.01040404e-01, 3.0... ,
methods=[ ' thin-plate ' , ' multiquadric ' , ' linear ' , ' cubic ' ] ,
varianceThreshold=None,
glintVector=False,
searchThreshold=40)
Fit an interpolator to the points via LOO x-validation |
source code
|
|
|
tuple<float, float, float>
|
SearchAndFit(self,
durations=array([1.98, 1.99, 2. , 2.01, 2.02, 2.03, 2.04, 2.05, 2.06, 2... ,
delays=array([1.98, 1.99, 2. , 2.01, 2.02, 2.03, 2.04, 2.05, 2.06, 2... ,
verbose=False)
Searches for best duration and delay |
source code
|
|
|
numpy.ndarray
|
TransformToScreenCoordinates(self,
pupilFinder=None,
trace=None,
videoFileName=None,
replaceNanWithPrevious=True)
Transforms an eyetracking video file or pupil finder to screen coords
using this calibration. |
source code
|
|
|
|
Save(self,
fileName)
Saves calibrated interpolators and whatever else |
source code
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
|
|
CalibrationOrder35 = [ 13, 30, 17, 16, 2, 27, 1, 28, 25, 10, 26...
order used in 1024x768 single repeat calibration (e.g.
|
|
|
CalibrationOrder70 = [ 13, 30, 17, 16, 2, 27, 1, 28, 25, 10, 26...
order used in 1024x768 two repeat calibration (e.g.
|
|
str
|
calibrationVideoFile
video file name
|
|
PupilFinder
|
pupilFinder
pupil finder object used to find calibration pupils
|
|
bool
|
hasGlint
can this object find the glint in addition to the pupil?
|
|
tuple<int, int, int, int>
|
calibrationBeginTime
Timestamp of first TTL in calibration
|
|
numpy.ndarray
|
calibrationPositions
screen pixel positions of calibration dots
|
|
list<int>
|
calibrationOrder
order in which the calibration dots are presented
|
|
float
|
calibrationDuration
time in seconds each dot is presented
|
|
float
|
calibrationDelay
time in seconds between the first TTL and presentation of first dot
|
|
float
|
bestDuration
If searching for different calibrationDurations, best duration found
|
|
float
|
bestDurationError
If searching for different calibrationDurections, error corresponding
to best duration
|
|
numpy.ndarray
|
initialCalibrationPositions
Stored copy of calibration positions, because calibrationPositions
will be shuffled according to presentation order
|
|
list<int>
|
initialCalibrationOrder
Stored copy of calibration order
|
|
numpy.ndarray
|
pupilCalibrationPositions
mean or median pupil positions in video positions for each
calibration point
|
|
numpy.ndarray
|
pupilCalibrationVariances
variance in calibration point eye positions
|
|
numpy.ndarray
|
glintCalibrationPositions
mean or median glint locations for each calibration point
|
|
numpy.ndarray
|
glintCalibrationVariances
variance in glint locations for each calibration point
|
|
float
|
bestSmoothness
best smootheness value for interpolating gaze location
|
|
str
|
bestMethod
best method for interpolating gaze location
|
|
float
|
bestError
best leave-one-out error for gaze interpolation fitting
|
|
scipy.interpolate.Rbf
|
horizontalInterpolater
final interpolator for X gaze location
|
|
scipy.interpolate.Rbf
|
verticalInterpolater
final interpolator for Y gaze location
|


The Unic
Menu
Download
Trailer
Contact
Presskit
The Unic, a game for pattern lovers
Download for free
Available for free
Made with
in France by
Lozange Lab
Email
Presskit


Swipe up to activate the checkbox, then tap it to accept the terms!
Big Sis by Springster is owned and operated by Girl Effect (Springster’s ‘mom’). Big Sis collects information (“data”) about you to help improve its service and help you make the most of what Big Sis has to offer. When we collect your data, we ensure that it is kept securely and we respect your privacy at all times.
We’re committed to providing you with this security and privacy and we’re also required to do this under various laws (such as ones about Data Protection and Privacy) applicable to Girl Effect, as our data is located in Europe.
INFORMATION WE MAY COLLECT FROM YOU
When you interact or talk to Big Sis, regardless of your geographical location or where ever you live, we will collect and store certain information about you. This information includes your name, age, gender and phone number. If you submit questions, answer quizzes, participate in polls, surveys and/or competitions, we will also store that information.
INFORMATION WE COLLECT BECAUSE YOU ARE USING BIG SIS BY SPRINGSTER
We may also collect information about which country and/or city you are using the service from, based on your Facebook Profile data. In addition, when engaging with related Springster products such as our website, through more technical methods, such as Cookies, we may also collect further information about your location (for example your village or town). (A cookie is a small text file that is downloaded onto your computer or smartphone when you access a website. It allows the website to recognise your device and store some information about your preferences or past actions). We use Cookies to keep track of things such as how many people from your general location have used the site. We will never use location information to actually locate you or find your home unless you have been specifically asked for this and have given us your explicit consent.
When participating in polls, quizzes, and surveys we may ask you to share information about yourself and your life or to tell us about your opinions and your experiences. You can choose what information you’d like to share. We will use this to help us make sure we are giving Big Sis and Springster users the best service and the most useful kinds of information.
DATA YOU MAY PROVIDE TO US WITHOUT ASKING
Sometimes, you may engage in a conversation with Big Sis. When you make comments or submit questions to Big Sis you may include information about yourself, your hobbies, family, things that have happened to you, things you would like to do, your thoughts and feelings. The information you provide is your responsibility. Please remember not to include personal information which may identify you when commenting or talking with Big Sis. We will use information provided in comments and questions to better understand what topics and stories people using Big Sis are interested in. We do this only to improve Big Sis and understand how it is used. We may also use anonymised comments and data about how Big Sis is used to let our donors and potential funders know how great Big Sis is.
If you are using Big Sis on Facebook Messenger the information that you share on the chatbot will automatically be associated with your Facebook profile. This information will not be shared publicly and we will only use it to help Big Sis learn and improve how it provides you with information.
USE OF YOUR DATA
Girl Effect staff (and those working on behalf of Girl Effect) who work on Springster or Big Sis may view your data whilst carrying out their jobs, all of whom have signed agreements confirming they will keep your information confidential and who are required to follow very strict guidelines around privacy and security. Our staff are carefully selected, trained and very committed to you as members of the Big Sis by Springster community.
In addition, we sometimes work with other companies or agencies to help us develop and manage Big Sis by Springster. These “3rd parties” may also have access to your data, though their job is not to review it and they are only being allowed to see your data so that they can help us reach people in the countries we operate in the best way possible. This group of “3rd parties” will also have signed an agreement with us about confidentiality and security which covers what they can and cannot do with your information. Again, we are very careful about the selection of our 3rd parties.
The third parties with whom we share data include:
- Content Partners: These partners help us write stories and create videos
- Content Moderators: Consultants and or Agencies that review comments and questions to keep users safe.
- Data Partners: We share data with these partners so that we can understand if Big Sis is working and to know what kinds of stories our users like and how we can improve Big Sis
- Technology Partners: Praekelt.org is Big Sis’s technology partner. Praekelt helps improve Big Sis and makes sure Big Sis is reliably working for our users.
- Research Partners: We share data with research partners so that they can help us understand if Big Sis is helpful for our users.
WHAT CAN YOU DO
You can ask us to completely delete all the data we have about you, this is also called your Right to be Forgotten. If you want us to delete your data, you will also need to stop using the service. If we do not have a very good reason to keep any of your information, we are happy to delete it all. However, there are times when we use your information for statistical or research purposes or to help Girl Effect achieve its goal of empowering girls. In these cases, we will remove all the factors which may identify you (also called ‘personally identifiable information’) and keep the rest for use as anonymised data (meaning that it isn’t possible to identify you). We will tell you if we do this. You can email us on<EMAIL_ADDRESS>to ask for your data to be deleted or if you have any other questions about your data.
You can also ask to receive a copy of the data we hold about you, should we have any, or for us to correct any of the information. These are also called your Right to Access and Right to Rectification. We will try our best to respond to requests within one month of confirming your identity. Please email us on<EMAIL_ADDRESS>and we will send you a form to complete so we know exactly what you would like us to do.
COMPLAINTS
If you are at all unhappy with the way we manage your data, you can always contact us on<EMAIL_ADDRESS>and we will do our best to respond to you as soon as we can, (and anyway, within a month).


The functionality for identifying streaming audio is contained in the Music-ID Stream module. This module contains the GnMusicIdStream
class that is designed to identify raw audio received in a continuous stream. You should instantiate one instance of this class for each audio stream you are using. GnMusicIdStream
can be started and stopped as the audio stream starts and stops. There is no need to destroy and recreate a GnMusicIdStream
instance due to breaks in the audio stream.
Using this class, your application primarily needs to provide two things:
Code an IGnMusicIdStreamEvents
events delegate object (GnMusicIdStreamEventsDelegate
in Objective-C) that receives callbacks for results, status messages, and other events.
Code a class that implements the IGnAudioSource
(GnAudioSource
in Objective-C) interface.
For some platforms (for example, iOS and Android), Gracenote provides the GnMic
helper class that implements the IGnAudioSource
interface. If available, your application can use this class to process streaming audio from a device microphone.
Notes:
At any point, your application can stop audio processing. When stopped, automatic data fetching ceases or,
if audio data is being provided manually, attempts to write data for processing
will fail. Internally, GnMusicIdStream
clears and releases all buffers and audio
processing modules. Audio processing can be restarted at any time.
Identification spawns a thread that completes asynchronously. However, methods for both synchronous and asynchronous identification are provded. If the sychronous method is called, the identification is still performed asynchronously and results delivered via a delegate implementing IGnMusicIdStreamEvents
, and the method does not return until the identification is complete. If a request is pending, any new ID requests are ignored.
Audio is identified using either a local database or the Gracenote online service. The default is to attempt a local identification first before going online. Local matches are only possible if GnLookupLocalStream
is enabled and a MusicID-Stream fingerprint bundle ingested.
Internally, GnMusicIdStream
pulls data from the audio source interface in a loop, so you may want to start automatic audio processing in a background thread to avoid stalling the main thread.
At any point, your application can request an identification of buffered audio. The identification process spawns a thread and completes asynchronously. Use the method IdentifyAsync
to identify music.
You can call IdentifyCancel
to stop an identification operation. Note that cancelling does not cease audio processing and your application can continue requesting identifications.
You can instantiate a GnMusicIdStream
object with a locale. Locales are a convenient way to group locale-dependent metadata specific to a region (such as Europe) and language that should be returned from the Gracenote service. See "Loading a Locale" for more information.
To identify streaming audio from an audio source (IGnAudioSource
implementation):
Code a IGnMusicIdStreamEvents
delegate class (GnMusicidStreamEventsDelegate
in Objective-C) to handle results, statuses, and other events.
Instantiate a GnMusicIdStream
object with your User object, a GnMusicIdStreamPreset
enum, and a IGnMusicIdStreamEvents
events delegate object. This establishes a MusicID-Steam audio channel. The GnMusicIdStreamPreset
enum can be for either 'microphone' or 'radio' (for example, speaker).
Instantiate a IGnAudioSource
object representing the audio source you wish to identify. On some platforms (iOS, Android, Windows Phone), Gracenote provides the GnMic
class, which is a IGnAudioSource
implementation for the device microphone.
Call the IGnAudioSource
instance's sourceInit
method to initialize your audio source.
Call the GnMusicIdStream
instance's AudioProcessStart
method with your IGnAudioSource
object. This starts the retrieval and processing of audio.
Note that, as an alternative to the above two steps, you could call the GnMusicIdStream
instance's audioProcess
method with PCM string data that you have captured through any means.
To identify audio, call GnMusicIdStream.IdentifyAlbumAsync
. Results are delivered asychnronously as audio is received.
Handle results and statuses in your event delegate callbacks.
If your app goes into the background, call audioProcessStop
; this releases resources and relinquishes control of the audio source. If it returns to the foreground, call audioProcessStart
again.
Examples
// Set up for continuous listening from the microphone // - Create microphone, this can live for lifetime of app // - Create GnMusicIdStream instance, this can live for lifetime of app // - Set options gnMicrophone = new GnMic(); // Init with default samples per second (8000), bits per sample (16) and num channels (1) gnMusicIdStream = new GnMusicIdStream( gnUser, GnMusicIdStreamPreset.kPresetMicrophone, new MusicIDStreamEvents() ); gnMusicIdStream.options().lookupData(GnLookupData.kLookupDataContent, true); gnMusicIdStream.options().lookupData(GnLookupData.kLookupDataSonicData, true); gnMusicIdStream.options().resultSingle( true ); // Start audio processing with GnMic, GnMusicIdStream pulls data from GnMic internally gnMicrophone.sourceInit(); // Initialize microphone gnMusicIdStream.audioProcessStart( gnMicrophone ); // Perform identification gnMusicIdStream.identifyAlbumAsync(); // Handle results in callback
mMic = [[GnMic alloc] initWithSampleRate:44100 bitsPerChannel:8 numberOfChannels:2]; mMusicAudio = [[GnMusicIdStream alloc] initWithGnUser:self.gnUser preset:kPresetMicrophone locale:self.locale musicIdStreamEventsDelegate: self]; -(void)start { NSError *error = nil; if(mMic & (0 == [mMic sourceInit])) { if (mMusicAudio) { [mMusicAudio audioProcessStartWithSamplesPerSecond:[mMic samplesPerSecond] bitsPerSample:[mMic sampleSizeInBits] numberOfChannels:[mMic numberOfChannels] error:&error]; } } [self performSelectorInBackground:@selector(processAudio) withObject:nil]; } -(void)processAudio { NSError *error = nil; NSMutableData *data = [[NSMutableData alloc] initWithLength:1024]; while (true) { NSInteger length = [mMic getData:data]; if(data) { [mMusicAudio audioProcess:data error:&error]; } } } //Call this when user request identification [mMusicAudio identifyAlbumAsync:&error]; // Handle results in callback
gnMic = new GnMic(); gnMic.SourceInit(); App.gnMusicIDStream_ = new GnMusicIdStream(App.gnMusicUser_, nMusicIdStreamPreset.kPresetMicrophone, this); App.gnMusicIDStream_.Options.ResultSingle(true); App.gnMusicIDStream_.Options.LookupData(GnLookupData.kLookupDataContent, true); if (gnMic.SampleSizeInBits() == 16) { App.gnMusicIDStream_.AudioProcessStart(gnMic.SamplesPerSecond(), 16, gnMic.NumberOfChannels()); } else { App.gnMusicIDStream_.AudioProcessStart(gnMic.SamplesPerSecond(), 8, gnMic.NumberOfChannels()); } //... bytesRead = gnMic.GetData(audioData, (uint)audioData.Length); App.gnMusicIDStream_.AudioProcess(audioData, bytesRead); // Call this when user requests identification App.gnMusicIDStream_.IdentifyAlbumAsync(); //Handle results in callback
You can use GnMusicIdStreamOptions
methods to set options for streaming audio queries. For example, you can set an option for local lookup. By default, a lookup is done online, but many applications will want to start with a local query first then, if no match is found, go online.
GnMusicIdStreamOptions
Query Option Methods:
LookupData
—Set GnLookupData
options to enable what data can be returned, for example, classical data, mood and tempo data, playlist, external IDs, and so on.LookupMode
—Set a lookup option with one of the GnLookupMode
enums. These include ones for local only, online only, online nocache, and so on.NetworkInterface
—Set a specific network interface to use with this object's connections.PreferResultLanguage
—Use one of the GnLanguage
enums to set the preferred language for results.PreferResultExternalId
—Specifies preference for results with external IDs. External IDs are 3rd party IDs used to cross link this metadata to 3rd party services.PreferResultCoverart
—Specifies preference for results with cover art.ResultSingle
—Specifies whether a response must return only the single best result. Default is true
.ResultRangeStart
— Specifies the result range start value. This must be less than or equal to the total number of results. If greater than the total number, no results are returned.ResultCount
— Specifies the result range count value.


David Flores | @dmouse
Eduardo García | @enzolutions
Jesús Manuel Olivas | @jmolivas
Omar Aguirre | @omers
# Run this in your terminal to get the latest project version:
curl https://drupalconsole.com/installer -L -o drupal.phar
# Accessing from anywhere on your system:
mv drupal.phar /usr/local/bin/drupal
# Apply executable permissions on the downloaded file:
chmod +x /usr/local/bin/drupal
# Check and validate system requirements
drupal check
# Copy configuration files to user home directory:
drupal init --override
$ composer global require drupal/console:@stable
# download path:
# ~/.composer/vendor/drupal/console
# run it using:
$ ~/.composer/vendor/bin/console
$ composer create-project
drupal-composer/drupal-project:8.x-dev
drupal8.dev
--stability dev
--no-interaction
$ drupal self-update
$ php console.phar self-update
$ composer global update drupal/console
# change directory to site path
$ cd /var/www/drupal8.dev
$ drupal
# use --root option
$ drupal --root=/var/www/drupal8.dev
Create a 'HelloController' Class with a 'hello' method at 'src/Controller' Directory.
Create a route with path to '/hello/{name}' at 'example.routing.yml' file.
In Drupal 8 we won’t need hook_menu() anymore as we make heavy use of the Symfony2 components to handle the routing. This involves defining the routes as configuration and handling the callback in a controller (the method of a Controller class).
Other component you will be requiring a lot within a contributed module is a configuration form.
Same as in the previous example, I am showing you the interactive mode.
What do you need to generate a Form in Drupal 8. You need a route, a form class and some field definitions,
Well all those features are added by the generator.
As you can see here, if you answer yes to "Do you want to generate a form structure" question, you will be ask to add fields.
The generated form included an integration with the configuration system, in order to store the user input values, when submiting the form.
In order to use this form we need to provide a route for it.
DrupalConsole creates for you the routing definition and use ther proper configuration, to specify that the target is a form class. And the value is the class name we just generated.
In Drupal 8, form definition functions are all grouped together inside a class.
That class must be defined on a specific namespace and the file created on the proper directory.
The generator command, also added the required use statements and extend the proper class.
$ drupal generate:plugin:block
--module="example"
--class="ExampleBlock"
--label="example_block"
--plugin-id="example_block"
--no-interaction
So far we have seen the interactive mode, which it is a little bit more flashy since you can see the questions and the entered answer.
But, starting from now we will show how to execute commands passing inline arguments, which is way more faster.
Make sure while executing commands using the inline mode to pass the "--no-interaction" op
Blocks in Drupal 8 are plugins, creating a plugin can be a little tricky, because you need to add annotations in order to this new block can be discoverable by the system.
But do not worry, beacuse console take care of adding them.
DrupalConsole generation add the required plugin block type anotations.
Using these annotations we let Drupal know that we want to register a new block type
$ drupal generate:entity:content
--module="example"
--entity-class="Foo"
--entity-name="foo"
--no-interaction
I have been showing you commands generating two or there files, which is probably not too impresive.
Remember what I told you about complexity in Drupal 8 ?.
Adding an entity on Drupal 8 is a complex task.
Because you need to create/update about 14 files.
Those files are classes, forms, routes and menu links.
Entities are plugins and require to add annotations same as in the block generation that code is added by the command.
The generated entity is fieldable from de UI and provides Views integration.
We started the project as a scaffolding code generator.
But eventually we have needed to test the generated code.
For that reason we added commands to interact with the Drupal Installation.
Using the container:debug command, you can list the registered services on service container within the current Drupal instance.
Similar to the previous example.
The router:debug command, helps you list the registered routes on the routing system, within the current Drupal instance.
You can inspect a route definition just by passingthe route_name as argument to the router:debug command.
site
site:maintenance [ON/OFF]
site:status
config
config:debug
config:edit
config:export
config:export:content:type
config:export:single
config:export:view
config:import
config:import:single
config:override
user
user:login:clear:attempts
user:login:url
user:password:hash
user:password:reset
$ drupal generate:controller
--module="example"
--class="ExampleController"
--routes="title:hello method:hello path:/hello/{name}"
--test --learning
However, this approach coud not be enough.
For that reason we provide you with an option to provide extra information to the generated code.
When executing a command using the "--learning" option, aditionaly to the generated boilerplate code, a commented block messages will be added, describing the code functionality.
NOTE: This option is only available for the "generate:controller" command, please let us now, where do you think this could be helpful.
If you are a module maintainer. You can write an integration to take advantage of drupal console features.
$ drupal generate:command
--module="example"
--class-name="HelloCommand"
--command="example:hello"
--no-interaction
The easy way to generate an integration is to execute the generate:command command.
This command will generate all the boiler-plate code to write a new command within your drupal 8 module.
From there you can implement your bussines logic.
https://www.drupal.org/project/webprofiler
Let me tell you about the awesome webprofiler project. Which is an implementation of Symfony WebProfiler.
The web-profiler collects information for all requests.
You can see how long the page take to load, how much memory was used, the number of executed SQL querys, the loaded forms and blocks, the current logged user between others.
This module was the first module to take advantage of Drupal Console features.
This command allow you to execute several request against your Drupal site and show you a result of average execution time and cosumed memory.
webprofiler:benchmark
webprofiler:export
webprofiler:list
Allow us to execute commands on any remote or local site from the local terminal.
application:
...
remote:
user: root
port: 22
console: /usr/local/bin/drupal
keys:
public: ~/.ssh/id_rsa.pub
private: ~/.ssh/id_rsa
passphrase: ~/.ssh/passphrase.txt
local:
root: /var/www/drupal8.dev
host: local
dev:
root: /var/www/html/drupal
host: <IP_ADDRESS>
user: drupal
prod:
root: /var/www/html/docroot
host: live.drupal.org
user: drupal
console: /var/www/html/docroot/console.phar
$ drupal --target=sample.dev cr all
$ drupal @sample.dev cr all
In this case I did run cache:rebuild command, but you can execute any drupalconsole command available on the remote server.
# ~/.console/config.yml
application:
environment: 'prod'
language: en
editor: vim
temp: /tmp
The DrupalConsole project is multilingual, jsut by changing the language value, you can tun the project in a supported language.
Do you remember the "--learning" option I mentioned before, the commented messages also support this multilingual feature.
# ~/.console/commands.yml
application:
...
default:
commands:
generate:
controller:
options:
module: my_current_project
You can set default values for commands (options and arguments), this is useful when you are working on a project and you dont want to type the module every time you generate a component.
# ~/.console/commands.yml
application:
...
disable:
modules:
- broken_module_name_one
- broken_module_name_two
Since any module can add provide an integration and add comands.
Disabling those module-commands to get loaded could be useful, when any those are introducing issues or errors.
$ drupal generate:entity:config --generate-inline
Remember the inline option execution.
You do not need to know each required option and argument, you can execute a command using the interactive mode, and just by passing the "--generate-inline" option.
The command will output the inline instruction, to execute the command the next time.
$ drupal generate:module --generate-chain
Executing a command and passing the "--generate-chain" option.
The command will output the YAML code, to copy and paste, this could be used when executing the chain command.
I mentioned about integration, using as example the webprofiler module, and I like to talk about contribution.
Anyone can contribute, you can add new features, write an integration with your custom module, improve transaltions and documentation.
But first you need to get the code right.
Fork your own copy of the Console repository
Clone your forked repository.
$ git clone git@github.com:[github-user]/DrupalConsole.git
Download dependencies using componser.
$ cd /path/to/DrupalConsole
$ composer install
... Getting the project is as easy as follow this 3 steps.
Fork the project
Clone your fork
Download dependencies
Before commiting your code you need to know
Since Drupal Console is not a Drupal module is a Symfony application, project code is PSR-2 Coding Style.
But don't worry, generated code is Drupal Coding Style.
We have the Platinum medal:
We use SensioLabsInsight a quality assurance tool to analyzes source code.
We use TravisCI, to run unit test on the sent PR.
We are starting to use this PHPQA tool to analyze code before commiting to the repo.
$ cd /path/to/DrupalConsole
$ phpqa analyze --files=src/
$ vim .git/hooks/pre-commit
# Paste this:
phpqa analyze --git
You can run it manually by executing the phpqa command and indicating the files or directory to scan by using the "--files" option.
Or maybe you can setup a pre-commit git-hook and use the "--git" option to scan all files added to git index.
This is the hall of fame of Drupal Console.
Without this people I would not be speaking at here.
What features are planned for development?
You can see, what features we are currently working at by visiting the milestones URL on the github repo.
I already talk about the webprofier integration.
But now I will list the modules with plans or currenlty working on implementing DrupalConsole commands.
Before we wrap up, I like to talk about a planned feature.
As mentioned before the goal of this project is provide a tool easy to use for everyone.
We are plannig a GUI for the CLI.
We really want to make the tool even more accessible to all site administrators of Drupal 8.
Adding a GUI for Drupal Console as an alternative to the CLI.
This could be especially useful for site builders wanting to take advante of this tool without needing to use the command line.
It could be used for code generation in the form of a downloadable compressed file.


{% extends 'pageWrapper.html' %} {% block head %} {{ super() }}
This page allows you to generate a game by uploading a config file or a zip file containing config files. If you do not have a config (.yaml) file yet, you may create one on the game's settings page, which you can find via the supported games list.
{% if race -%}
This game will be generated in race mode,
meaning the spoiler log will be unavailable and game specific protections will be in place,
like ROM encryption or cheat mode removal.
{%- else -%}
If you would like to generate a race game,
click here.
Race games are generated without a spoiler log and game specific protections will be in place,
like ROM encryption or cheat mode removal.
{%- endif -%}


India growth: heading lower – ANZ
by Haresh MenghaniAnalysts at Australia and New Zealand Banking Group (ANZ) expect India’s Q2 FY20 (July-September quarter) GDP growth to have slowed further to 4.6% y/y from 5% in the previous quarter.
Key Quotes:
“Coming against favourable base effects, it will mark the slowest pace of growth since March 2013.”
“We are also downgrading our FY20 (ending March 2020) growth to 5.1%, from 5.8% previously.”
“We are cautious on a material improvement in the growth outlook in H2 FY20 as high-frequency indicators remain sluggish. We estimate the output gap to have widened to 0.8% of GDP in Q2 FY20 from 0.4% previously.”
“We, therefore, maintain our call for the Reserve Bank of India (RBI) to deliver another 50bps of cumulative cuts in the remainder of this fiscal year. A 25bp rate cut at the next policy review on 5 December appears imminent.”


# Processes The process object is a global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require(): ```js const process = require('process'); ``` --- ## Process Events The process object is an instance of EventEmitter. - Event: 'beforeExit' - Event: 'disconnect' - Event: 'exit' - Event: 'message' - Event: 'multipleResolves' - Event: 'rejectionHandled' - Event: 'uncaughtException' - Event: 'unhandledRejection' - Event: 'warning' - Signal Events --- ### Event: 'beforeExit'# The 'beforeExit' event is emitted when Node.js empties its event loop and has no additional work to schedule. Normally, the Node.js process will exit when there is no work scheduled, but a listener registered on the 'beforeExit' event can make asynchronous calls, and thereby cause the Node.js process to continue. -- The listener callback function is invoked with the value of process.exitCode passed as the only argument. -- The 'beforeExit' event is not emitted for conditions causing explicit termination, such as calling process.exit() or uncaught exceptions. -- The 'beforeExit' should not be used as an alternative to the 'exit' event unless the intention is to schedule additional work. --- ### Event: 'disconnect' If the Node.js process is spawned with an IPC channel (see the Child Process and Cluster documentation), the 'disconnect' event will be emitted when the IPC channel is closed. --- ### Event: 'exit' ``` code
``` The 'exit' event is emitted when the Node.js process is about to exit as a result of either: - The process.exit() method being called explicitly; - The Node.js event loop no longer having any additional work to perform. -- There is no way to prevent the exiting of the event loop at this point, and once all 'exit' listeners have finished running the Node.js process will terminate. -- The listener callback function is invoked with the exit code specified either by the process.exitCode property, or the exitCode argument passed to the process.exit() method. ```js process.on('exit', (code) => { console.log(`About to exit with code: ${code}`); }); ``` --- ### Event: 'exit' ... Listener functions must only perform synchronous operations. The Node.js process will exit immediately after calling the 'exit' event listeners causing any additional work still queued in the event loop to be abandoned. In the following example, for instance, the timeout will never occur: ```js process.on('exit', (code) => { setTimeout(() => { console.log('This will not run'); }, 0); }); ``` --- ### Event: 'message' ``` message
|
|
|
|
a parsed JSON object or a serializable primitive value. sendHandle
|
a net.Server or net.Socket object, or undefined. ``` -- If the Node.js process is spawned with an IPC channel (see the Child Process and Cluster documentation), the 'message' event is emitted whenever a message sent by a parent process using childprocess.send() is received by the child process. The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent. --- ### Event: 'multipleResolves' ``` type
The resolution type. One of 'resolve' or 'reject'. promise
The promise that resolved or rejected more than once. value
The value with which the promise was either resolved or rejected after the original resolve. ``` -- The 'multipleResolves' event is emitted whenever a Promise has been either: - Resolved more than once. - Rejected more than once. - Rejected after resolve. - Resolved after reject. This is useful for tracking potential errors in an application while using the Promise constructor, as multiple resolutions are silently swallowed. However, the occurrence of this event does not necessarily indicate an error. --- ### Event: 'multipleResolves' ... For example, Promise.race() can trigger a 'multipleResolves' event. ```js process.on('multipleResolves', (type, promise, reason) => { console.error(type, promise, reason); setImmediate(() => process.exit(1)); }); async function main() { try { return await new Promise((resolve, reject) => { resolve('First call'); resolve('Swallowed resolve'); reject(new Error('Swallowed reject')); }); } catch { throw new Error('Failed'); } } main().then(console.log); // resolve: Promise { 'First call' } 'Swallowed resolve' // reject: Promise { 'First call' } Error: Swallowed reject // at Promise (*) // at new Promise (
) // at main (*) // First call ``` --- ### Event: 'rejectionHandled' ``` promise
The late handled promise. ``` -- The 'rejectionHandled' event is emitted whenever a Promise has been rejected and an error handler was attached to it (using promise.catch(), for example) later than one turn of the Node.js event loop. -- The Promise object would have previously been emitted in an 'unhandledRejection' event, but during the course of processing gained a rejection handler. -- There is no notion of a top level for a Promise chain at which rejections can always be handled. Being inherently asynchronous in nature, a Promise rejection can be handled at a future point in time — possibly much later than the event loop turn it takes for the 'unhandledRejection' event to be emitted. --- ### Event: 'rejectionHandled' ... Another way of stating this is that, unlike in synchronous code where there is an ever-growing list of unhandled exceptions, with Promises there can be a growing-and-shrinking list of unhandled rejections. -- In synchronous code, the 'uncaughtException' event is emitted when the list of unhandled exceptions grows. -- In asynchronous code, the 'unhandledRejection' event is emitted when the list of unhandled rejections grows, and the 'rejectionHandled' event is emitted when the list of unhandled rejections shrinks. --- ### Event: 'rejectionHandled' ... ```js const unhandledRejections = new Map(); process.on('unhandledRejection', (reason, promise) => { unhandledRejections.set(promise, reason); }); process.on('rejectionHandled', (promise) => { unhandledRejections.delete(promise); }); ``` -- In this example, the unhandledRejections Map will grow and shrink over time, reflecting rejections that start unhandled and then become handled. It is possible to record such errors in an error log, either periodically (which is likely best for long-running application) or upon process exit (which is likely most convenient for scripts). --- ### Event: 'uncaughtException' ``` err
The uncaught exception. origin
Indicates if the exception originates from an unhandled rejection or from synchronous errors. Can either be 'uncaughtException' or 'unhandledRejection'. ``` -- The 'uncaughtException' event is emitted when an uncaught JavaScript exception bubbles all the way back to the event loop. -- By default, Node.js handles such exceptions by printing the stack trace to stderr and exiting with code 1, overriding any previously set process.exitCode. Adding a handler for the 'uncaughtException' event overrides this default behavior. --- ### Event: 'uncaughtException' ... Alternatively, change the process.exitCode in the 'uncaughtException' handler which will result in the process exiting with the provided exit code. Otherwise, in the presence of such handler the process will exit with 0. ```js process.on('uncaughtException', (err, origin) => { fs.writeSync( process.stderr.fd, `Caught exception: ${err}\n` + `Exception origin: ${origin}` ); }); setTimeout(() => { console.log('This will still run.'); }, 500); // Intentionally cause an exception, but don't catch it. nonexistentFunc(); console.log('This will not run.'); ``` --- ### Event: 'unhandledRejection' ``` reason
|
The object with which the promise was rejected (typically an Error object). promise
The rejected promise. ``` -- The 'unhandledRejection' event is emitted whenever a Promise is rejected and no error handler is attached to the promise within a turn of the event loop. When programming with Promises, exceptions are encapsulated as "rejected promises". Rejections can be caught and handled using promise.catch() and are propagated through a Promise chain. The 'unhandledRejection' event is useful for detecting and keeping track of promises that were rejected whose rejections have not yet been handled. ```js process.on('unhandledRejection', (reason, promise) => { console.log('Unhandled Rejection at:', promise, 'reason:', reason); // Application specific logging, throwing an error, or other logic here }); somePromise.then((res) => { return reportToUser(JSON.pasre(res)); // Note the typo ('pasre') }); // No '.catch()' or '.then()' ``` --- ### Event: 'unhandledRejection' ... The following will also trigger the 'unhandledRejection' event to be emitted: ```js function SomeResource() { // Initially set the loaded status to a rejected promise this.loaded = Promise.reject(new Error('Resource not yet loaded!')); } const resource = new SomeResource(); // no .catch or .then on resource.loaded for at least a turn ``` In this example case, it is possible to track the rejection as a developer error as would typically be the case for other 'unhandledRejection' events. To address such failures, a non-operational .catch(() => { }) handler may be attached to resource.loaded, which would prevent the 'unhandledRejection' event from being emitted. --- ### Event: 'warning' ``` warning
Key properties of the warning are: name
The name of the warning. Default: 'Warning'. message
A system-provided description of the warning. stack
A stack trace to the location in the code where the warning was issued. ``` The 'warning' event is emitted whenever Node.js emits a process warning. --- ### Event: 'warning' ... A process warning is similar to an error in that it describes exceptional conditions that are being brought to the user's attention. However, warnings are not part of the normal Node.js and JavaScript error handling flow. Node.js can emit warnings whenever it detects bad coding practices that could lead to sub-optimal application performance, bugs, or security vulnerabilities. ```js process.on('warning', (warning) => { console.warn(warning.name); // Print the warning name console.warn(warning.message); // Print the warning message console.warn(warning.stack); // Print the stack trace }); ``` --- ### Event: 'warning' ... By default, Node.js will print process warnings to stderr. The --no-warnings command-line option can be used to suppress the default console output but the 'warning' event will still be emitted by the process object. The following example illustrates the warning that is printed to stderr when too many listeners have been added to an event: ```shell $ node > events.defaultMaxListeners = 1; > process.on('foo', () => {}); > process.on('foo', () => {}); > (node:38638) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 2 foo listeners added. Use emitter.setMaxListeners() to increase limit ``` --- ### Event: 'warning' ... In contrast, the following example turns off the default warning output and adds a custom handler to the 'warning' event: ```shell $ node --no-warnings > const p = process.on('warning', (warning) => console.warn('Do not do that!')); > events.defaultMaxListeners = 1; > process.on('foo', () => {}); > process.on('foo', () => {}); > Do not do that! ``` --- ### Event: 'warning' ... The --trace-warnings command-line option can be used to have the default console output for warnings include the full stack trace of the warning. Launching Node.js using the --throw-deprecation command line flag will cause custom deprecation warnings to be thrown as exceptions. Using the --trace-deprecation command line flag will cause the custom deprecation to be printed to stderr along with the stack trace. Using the --no-deprecation command line flag will suppress all reporting of the custom deprecation. The *-deprecation command line flags only affect warnings that use the name 'DeprecationWarning'. --- ### Signal Events Signal events will be emitted when the Node.js process receives a signal. Please refer to signal(7) for a listing of standard POSIX signal names such as 'SIGINT', 'SIGHUP', etc. The signal handler will receive the signal's name ('SIGINT', 'SIGTERM', etc.) as the first argument. The name of each event will be the uppercase common name for the signal (e.g. 'SIGINT' for SIGINT signals). ```js // Begin reading from stdin so the process does not exit. process.stdin.resume(); process.on('SIGINT', () => { console.log('Received SIGINT. Press Control-D to exit.'); }); // Using a single function to handle multiple signals function handle(signal) { console.log(`Received ${signal}`); } process.on('SIGINT', handle); process.on('SIGTERM', handle); ``` --- ## process.abort() The process.abort() method causes the Node.js process to exit immediately and generate a core file. This feature is not available in Worker threads. --- ## process.arch ```
``` -- The process.arch property returns a string identifying the operating system CPU architecture for which the Node.js binary was compiled. The current possible values are: 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'. ```js console.log(`This processor architecture is ${process.arch}`); ``` --- ### process.cwd() ``` Returns:
``` -- The process.cwd() method returns the current working directory of the Node.js process. ```js console.log(`Current directory: ${process.cwd()}`); ``` --- ## process.argv ```
``` -- The process.argv property returns an array containing the command line arguments passed when the Node.js process was launched. The first element will be process.execPath. See `process.argv0` if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed. The remaining elements will be any additional command line arguments. --- ## process.argv ... For example, assuming the following script for process-args.js: ```js // print process.argv process.argv.forEach((val, index) => { console.log(`${index}: ${val}`); }); ``` Launching the Node.js process as: ```shell $ node process-args.js one two=three four ``` Would generate the output: ```shell 0: /usr/local/bin/node 1: /Users/mjr/work/node/process-args.js 2: one 3: two=three 4: four ``` --- ## process.argv0 ```
``` -- The process.argv0 property stores a read-only copy of the original value of argv[0] passed when Node.js starts. ```shell $ bash -c 'exec -a customArgv0 ./node' > process.argv[0] '/Volumes/code/external/node/out/Release/node' > process.argv0 'customArgv0' ``` --- # The End


Introduction to Phylogenetics
JT McCrone
Andrew Rambaut group
University of Edinburgh
Phylogenetics model the unobserved past
Building a tree (distance)
Building a tree (Likelihood)
Placing a tree in time
Building a time tree
Building a time tree


This page tests if the cursors for dragging the map and the markers behave as expected. The left marker is draggable, the right one is not.
Map dragging enabled:
Map dragging disabled:


Collection
Research from the national evaluation of the implementation and impact of Diplomas from 2008 to 2013.
Research reports published in the last 5 years are available on GOV.UK. You can find our archived research on the National Archives . Note: the search function is not available on archived content so please use the filters on the left of each page.
Published: 30 June 2011
From: Department for Education
Part of: Curriculum and qualifications


This category has these items in this index.
These charities accept any item which you believe falls into this category


In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included in the notebook, be sure that the Python code is successfully imported and included in your submission if necessary.
Note: Once you have completed all of the code implementations, you need to finalize your work by exporting the iPython Notebook as an HTML document. Before exporting the notebook to html, all of the code cells need to have been run so that reviewers can see the final implementation and output. You can then export the notebook by using the menu above and navigating to \n", "File -> Download as -> HTML (.html). Include the finished document along with this notebook as your submission.
In addition to implementing code, there is a writeup to complete. The writeup should be completed in a separate file, which can be either a markdown file or a pdf document. There is a write up template that can be used to guide the writing process. Completing the code template and writeup template will cover all of the rubric points for this project.
The rubric contains "Stand Out Suggestions" for enhancing the project beyond the minimum requirements. The stand out suggestions are optional. If you decide to pursue the "stand out suggestions", you can include the code in this Ipython notebook and also discuss the results in the writeup file.
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. In addition, Markdown cells can be edited by typically double-clicking the cell to enter edit mode.
import urllib.request
print('Beginning file download...')
url = 'https://s3-us-west-1.amazonaws.com/udacity-selfdrivingcar/traffic-signs-data.zip'
urllib.request.urlretrieve(url, './traffic-signs-data.zip')
import zipfile
import os
print('Beginning file unzip')
zip_ref = zipfile.ZipFile('./traffic-signs-data.zip', 'r')
zip_ref.extractall('./')
zip_ref.close()
print('Done')
os.listdir("./")
# Load pickled data
import pickle
# TODO: Fill this in based on where you saved the training and testing data
training_file = './train.p'
validation_file= './valid.p'
testing_file = './test.p'
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(validation_file, mode='rb') as f:
valid = pickle.load(f)
with open(testing_file, mode='rb') as f:
test = pickle.load(f)
X_train, y_train = train['features'], train['labels']
X_valid, y_valid = valid['features'], valid['labels']
X_test, y_test = test['features'], test['labels']
The pickled data is a dictionary with 4 key/value pairs:
'features'
is a 4D array containing raw pixel data of the traffic sign images, (num examples, width, height, channels).'labels'
is a 1D array containing the label/class id of the traffic sign. The file signnames.csv
contains id -> name mappings for each id.'sizes'
is a list containing tuples, (width, height) representing the original width and height the image.'coords'
is a list containing tuples, (x1, y1, x2, y2) representing coordinates of a bounding box around the sign in the image. THESE COORDINATES ASSUME THE ORIGINAL IMAGE. THE PICKLED DATA CONTAINS RESIZED VERSIONS (32 by 32) OF THESE IMAGESComplete the basic data summary below. Use python, numpy and/or pandas methods to calculate the data summary rather than hard coding the results. For example, the pandas shape method might be useful for calculating some of the summary results.
import numpy as np
import pandas as pd
### Replace each question mark with the appropriate value.
### Use python, pandas or numpy methods rather than hard coding the results
# TODO: Number of training examples
n_train = X_train.shape[0]
# TODO: Number of validation examples
n_validation = X_valid.shape[0]
# TODO: Number of testing examples.
n_test = X_test.shape[0]
# TODO: What's the shape of an traffic sign image?
image_shape = X_train.shape[1:]
# TODO: How many unique classes/labels there are in the dataset.
n_classes = len(np.unique(y_train))
print("Number of training examples =", n_train)
print("Number of testing examples =", n_test)
print("Number of validation examples =", n_validation)
print("Image data shape =", image_shape)
print("Number of classes =", n_classes)
Visualize the German Traffic Signs Dataset using the pickled file(s). This is open ended, suggestions include: plotting traffic sign images, plotting the count of each sign, etc.
The Matplotlib examples and gallery pages are a great resource for doing visualizations in Python.
NOTE: It's recommended you start with something simple first. If you wish to do more, come back to it after you've completed the rest of the sections. It can be interesting to look at the distribution of classes in the training, validation and test set. Is the distribution the same? Are there more examples of some classes than others?
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
cols (Default = 1): Number of columns in figure (number of rows is
set to np.ceil(n_images/float(cols))).
titles: List of titles corresponding to each image. Must have
the same length as titles.
"""
assert((titles is None)or (len(images) == len(titles)))
n_images = len(images)
if titles is None: titles = ['Image (%d)' % i for i in range(1,n_images + 1)]
fig = plt.figure(figsize=(2, 2))
for n, (image, title) in enumerate(zip(images, titles)):
a = fig.add_subplot(cols, np.ceil(n_images/float(cols)), n + 1)
a.grid(False)
a.axis('off')
if image.ndim == 2:
plt.gray()
plt.imshow(image, cmap='gray')
a.set_title(title)
fig.set_size_inches(np.array(fig.get_size_inches()) * n_images)
plt.show()
def select_random_images_by_classes(features, labels, n_features):
indexes = []
_classes = np.unique(labels);
while len(indexes) < len(_classes):
index = random.randint(0, n_features-1)
_class = labels[index]
for i in range(0, len(_classes)):
if _class == _classes[i]:
_classes[i] = -1
indexes.append(index)
break
images = []
titles = []
for i in range(0, len(indexes)):
images.append(features[indexes[i]])
titles.append("class " + str(labels[indexes[i]]))
show_images(images, titles = titles)
### Data exploration visualization code goes here.
### Feel free to use as many code cells as needed.
import matplotlib.pyplot as plt
import random
# Visualizations will be shown in the notebook.
%matplotlib inline
select_random_images_by_classes(X_train, y_train, n_train)
def plot_distribution_chart(x, y, xlabel, ylabel, width, color):
plt.figure(figsize=(15,7))
plt.ylabel(ylabel, fontsize=18)
plt.xlabel(xlabel, fontsize=16)
plt.bar(x, y, width, color=color)
plt.show()
_classes, counts = np.unique(y_train, return_counts=True)
plot_distribution_chart(_classes, counts, 'Classes', '# Training Examples', 0.7, 'blue')
Design and implement a deep learning model that learns to recognize traffic signs. Train and test your model on the German Traffic Sign Dataset.
The LeNet-5 implementation shown in the classroom at the end of the CNN lesson is a solid starting point. You'll have to change the number of classes and possibly the preprocessing, but aside from that it's plug and play!
With the LeNet-5 solution from the lecture, you should expect a validation set accuracy of about 0.89. To meet specifications, the validation set accuracy will need to be at least 0.93. It is possible to get an even higher accuracy, but 0.93 is the minimum for a successful project submission.
There are various aspects to consider when thinking about this problem:
Here is an example of a published baseline model on this problem. It's not required to be familiar with the approach used in the paper but, it's good practice to try to read papers like these.
Minimally, the image data should be normalized so that the data has mean zero and equal variance. For image data, (pixel - 128)/ 128
is a quick way to approximately normalize the data and can be used in this project.
Other pre-processing steps are optional. You can try different techniques to see if it improves performance.
Use the code cell (or multiple code cells, if necessary) to implement the first step of your project.
1. Augmentation
import cv2
def augment_brightness_camera_images(image):
image1 = cv2.cvtColor(image,cv2.COLOR_RGB2HSV)
random_bright = .25+np.random.uniform()
#print(random_bright)
image1[:,:,2] = image1[:,:,2]*random_bright
image1 = cv2.cvtColor(image1,cv2.COLOR_HSV2RGB)
return image1
def transform_image(img,ang_range,shear_range,trans_range,brightness=0):
'''
This function transforms images to generate new images.
The function takes in following arguments,
1- Image
2- ang_range: Range of angles for rotation
3- shear_range: Range of values to apply affine transform to
4- trans_range: Range of values to apply translations over.
A Random uniform distribution is used to generate different parameters for transformation
'''
# Rotation
ang_rot = np.random.uniform(ang_range)-ang_range/2
rows,cols,ch = img.shape
Rot_M = cv2.getRotationMatrix2D((cols/2,rows/2),ang_rot,1)
# Translation
tr_x = trans_range*np.random.uniform()-trans_range/2
tr_y = trans_range*np.random.uniform()-trans_range/2
Trans_M = np.float32([[1,0,tr_x],[0,1,tr_y]])
# Shear
pts1 = np.float32([[5,5],[20,5],[5,20]])
pt1 = 5+shear_range*np.random.uniform()-shear_range/2
pt2 = 20+shear_range*np.random.uniform()-shear_range/2
# Brightness
pts2 = np.float32([[pt1,5],[pt2,pt1],[5,pt2]])
shear_M = cv2.getAffineTransform(pts1,pts2)
img = cv2.warpAffine(img,Rot_M,(cols,rows))
img = cv2.warpAffine(img,Trans_M,(cols,rows))
img = cv2.warpAffine(img,shear_M,(cols,rows))
if brightness == 1:
img = augment_brightness_camera_images(img)
return img
#Test augmentation function
images = []
for i in range(0, 100):
images.append(transform_image(X_train[555],10,5,5,brightness=1))
show_images(images)
Based on distribution of training data, augment the dataset
for _class, count in zip(_classes, counts):
new_images = []
new_classes = []
if count < 1000:
y_train_length = y_train.shape[0]
index = 0
for i in range(0, 1000-count):
while y_train[index] != _class:
index = random.randint(0, y_train_length-1)
new_images.append(transform_image(X_train[index],10,5,5,brightness=1))
new_classes.append(_class)
X_train = np.concatenate((X_train, np.array(new_images)))
y_train = np.concatenate((y_train, np.array(new_classes)))
_classes, counts = np.unique(y_train, return_counts=True)
plot_distribution_chart(_classes, counts, 'Classes', '# Training Examples', 0.7, 'blue')
#check dimentions
n_train = X_train.shape[0]
print("Number of training examples =", n_train)
3. Convert images to grayscale
X_train_gray = np.sum(X_train/3, axis=3, keepdims=True)
X_test_gray = np.sum(X_test/3, axis=3, keepdims=True)
X_valid_gray = np.sum(X_valid/3, axis=3, keepdims=True)
# check grayscale images
select_random_images_by_classes(X_train_gray.squeeze(), y_train, n_train)
4. Mean Substraction
X_train_gray -= np.mean(X_train_gray)
X_test_gray -= np.mean(X_test_gray)
X_train = X_train_gray
X_test = X_test_gray
5. Split and Shuffling Data
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
X_train, X_validation, y_train, y_validation = train_test_split(X_train, y_train, test_size=0.20, random_state=42)
X_train, y_train = shuffle(X_train, y_train)
import tensorflow as tf
from tensorflow.contrib.layers import flatten
EPOCHS = 100
BATCH_SIZE = 128
def LeNet(x):
# Arguments used for tf.truncated_normal, randomly defines variables for the weights and biases for each layer
mu = 0
sigma = 0.1
# TODO: Layer 1: Convolutional. Input = 32x32x1. Output = 28x28x6.
conv1_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 1, 6), mean = mu, stddev = sigma))
conv1_b = tf.Variable(tf.zeros(6))
conv1 = tf.nn.conv2d(x, conv1_W, strides=[1, 1, 1, 1], padding='VALID') + conv1_b
# TODO: Activation.
conv1 = tf.nn.relu(conv1)
# TODO: Pooling. Input = 28x28x6. Output = 14x14x6.
conv1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID')
# TODO: Layer 2: Convolutional. Output = 10x10x16.
conv2_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 6, 16), mean = mu, stddev = sigma))
conv2_b = tf.Variable(tf.zeros(16))
conv2 = tf.nn.conv2d(conv1, conv2_W, strides=[1, 1, 1, 1], padding='VALID') + conv2_b
# TODO: Activation.
conv2 = tf.nn.relu(conv2)
# TODO: Pooling. Input = 10x10x16. Output = 5x5x16.
conv2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID')
# TODO: Flatten. Input = 5x5x16. Output = 400.
fc0 = flatten(conv2)
# TODO: Layer 3: Fully Connected. Input = 400. Output = 120.
fc1_W = tf.Variable(tf.truncated_normal(shape=(400, 120), mean = mu, stddev = sigma))
fc1_b = tf.Variable(tf.zeros(120))
fc1 = tf.matmul(fc0, fc1_W) + fc1_b
# TODO: Activation.
fc1 = tf.nn.relu(fc1)
# TODO: Layer 4: Fully Connected. Input = 120. Output = 84.
fc2_W = tf.Variable(tf.truncated_normal(shape=(120, 84), mean = mu, stddev = sigma))
fc2_b = tf.Variable(tf.zeros(84))
fc2 = tf.matmul(fc1, fc2_W) + fc2_b
# TODO: Activation.
fc2 = tf.nn.relu(fc2)
# TODO: Layer 5: Fully Connected. Input = 84. Output = 43.
fc3_W = tf.Variable(tf.truncated_normal(shape=(84, 43), mean = mu, stddev = sigma))
fc3_b = tf.Variable(tf.zeros(43))
logits = tf.matmul(fc2, fc3_W) + fc3_b
return logits
x = tf.placeholder(tf.float32, (None, 32, 32, 1))
y = tf.placeholder(tf.int32, (None))
one_hot_y = tf.one_hot(y, 43)
A validation set can be used to assess how well the model is performing. A low accuracy on the training and validation sets imply underfitting. A high accuracy on the training set but low accuracy on the validation set implies overfitting.
### Train your model here.
### Calculate and report the accuracy on the training and validation set.
### Once a final model architecture is selected,
### the accuracy on the test set should be calculated and reported as well.
### Feel free to use as many code cells as needed.
rate = 0.001
logits = LeNet(x)
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(labels=one_hot_y, logits=logits)
loss_operation = tf.reduce_mean(cross_entropy)
optimizer = tf.train.AdamOptimizer(learning_rate = rate)
training_operation = optimizer.minimize(loss_operation)
correct_prediction = tf.equal(tf.argmax(logits, 1), tf.argmax(one_hot_y, 1))
accuracy_operation = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
saver = tf.train.Saver()
def evaluate(X_data, y_data):
num_examples = len(X_data)
total_accuracy = 0
sess = tf.get_default_session()
for offset in range(0, num_examples, BATCH_SIZE):
batch_x, batch_y = X_data[offset:offset+BATCH_SIZE], y_data[offset:offset+BATCH_SIZE]
accuracy = sess.run(accuracy_operation, feed_dict={x: batch_x, y: batch_y})
total_accuracy += (accuracy * len(batch_x))
return total_accuracy / num_examples
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
num_examples = len(X_train)
print("Training...")
print()
for i in range(EPOCHS):
X_train, y_train = shuffle(X_train, y_train)
for offset in range(0, num_examples, BATCH_SIZE):
end = offset + BATCH_SIZE
batch_x, batch_y = X_train[offset:end], y_train[offset:end]
sess.run(training_operation, feed_dict={x: batch_x, y: batch_y})
validation_accuracy = evaluate(X_validation, y_validation)
print("EPOCH {} ...".format(i+1))
print("Validation Accuracy = {:.3f}".format(validation_accuracy))
print()
saver.save(sess, './lenet')
print("Model saved")
To give yourself more insight into how your model is working, download at least five pictures of German traffic signs from the web and use your model to predict the traffic sign type.
You may find signnames.csv
useful as it contains mappings from the class id (integer) to the actual sign name.
### Load the images and plot them here.
### Feel free to use as many code cells as needed.
from google.colab import files
#os.remove('./1.png')
#os.remove('./2.png')
#os.remove('./3.png')
#os.remove('./4.png')
#os.remove('./5.png')
uploaded = files.upload()
import glob
import cv2
images = sorted(glob.glob('./*.png'))
labels = np.array([0, 14, 25, 22, 17])
X_images_test = []
titles = []
for image, label in zip(images, labels):
img = cv2.cvtColor(cv2.imread(image), cv2.COLOR_BGR2RGB)
X_images_test.append(img)
titles.append("class " + str(label))
show_images(X_images_test, titles=titles)
images = np.array(X_images_test)
X_images_test = np.array(X_images_test)
X_images_test_gray = np.sum(X_images_test/3, axis=3, keepdims=True)
X_images_test_gray -= np.mean(X_images_test_gray)
X_images_test = X_images_test_gray
### Run the predictions here and use the model to output the prediction for each image.
### Make sure to pre-process the images with the same pre-processing pipeline used earlier.
### Feel free to use as many code cells as needed.
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
saver3 = tf.train.import_meta_graph('./lenet.meta')
saver3.restore(sess, "./lenet")
accuracy = evaluate(X_images_test, labels)
### Calculate the accuracy for these 5 new images.
### For example, if the model predicted 1 out of 5 signs correctly, it's 20% accurate on these new images.
print("Accuracy = " + str(accuracy*100) + "%")
For each of the new images, print out the model's softmax probabilities to show the certainty of the model's predictions (limit the output to the top 5 probabilities for each image). tf.nn.top_k
could prove helpful here.
The example below demonstrates how tf.nn.top_k can be used to find the top k predictions for each image.
tf.nn.top_k
will return the values and indices (class ids) of the top k predictions. So if k=3, for each sign, it'll return the 3 largest probabilities (out of a possible 43) and the correspoding class ids.
Take this numpy array as an example. The values in the array represent predictions. The array contains softmax probabilities for five candidate images with six possible classes. tf.nn.top_k
is used to choose the three classes with the highest probability:
# (5, 6) array
a = np.array([[ 0.24879643, 0.07032244, 0.12641572, 0.34763842, 0.07893497,
0.12789202],
[ 0.28086119, 0.27569815, 0.08594638, 0.0178669 , 0.18063401,
0.15899337],
[ 0.26076848, 0.23664738, 0.08020603, 0.07001922, 0.1134371 ,
0.23892179],
[ 0.11943333, 0.29198961, 0.02605103, 0.26234032, 0.1351348 ,
0.16505091],
[ 0.09561176, 0.34396535, 0.0643941 , 0.16240774, 0.24206137,
0.09155967]])
Running it through sess.run(tf.nn.top_k(tf.constant(a), k=3))
produces:
TopKV2(values=array([[ 0.34763842, 0.24879643, 0.12789202],
[ 0.28086119, 0.27569815, 0.18063401],
[ 0.26076848, 0.23892179, 0.23664738],
[ 0.29198961, 0.26234032, 0.16505091],
[ 0.34396535, 0.24206137, 0.16240774]]), indices=array([[3, 0, 5],
[0, 1, 4],
[0, 5, 1],
[1, 3, 5],
[1, 4, 3]], dtype=int32))
Looking just at the first row we get [ 0.34763842, 0.24879643, 0.12789202]
, you can confirm these are the 3 largest probabilities in a
. You'll also notice [3, 0, 5]
are the corresponding indices.
### Print out the top five softmax probabilities for the predictions on the German traffic sign images found on the web.
### Feel free to use as many code cells as needed.
softmax_logits = tf.nn.softmax(logits)
top_k = tf.nn.top_k(softmax_logits, k=3)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
saver = tf.train.import_meta_graph('./lenet.meta')
saver.restore(sess, "./lenet")
my_softmax_logits = sess.run(softmax_logits, feed_dict={x: X_images_test})
my_top_k = sess.run(top_k, feed_dict={x: X_images_test})
fig, axs = plt.subplots(len(images),4, figsize=(12, 14))
axs = axs.ravel()
for i, image in enumerate(images):
axs[4*i].axis('off')
axs[4*i].imshow(image)
axs[4*i].set_title('Original')
for j in range(3):
guess = my_top_k[1][i][j]
index = np.argwhere(y_validation == guess)[0]
axs[4*i+j+1].axis('off')
axs[4*i+j+1].imshow(X_validation[index].squeeze(), cmap='gray')
axs[4*i+j+1].set_title('top guess: {} ({:.0f}%)'.format(guess, 100*my_top_k[0][i][j]))


[2.0/4.0]
One of the most inspirational chapters in American history is the Civil War. It has been the source of voluminous works of literature, including numerous films. Many of those examine similar themes and use familiar settings. This film is different in that it is set in one of the lesser known theaters of the war -- the guerilla battles in the state of Kansas.
The opening of the film gives a brief overview of the historical situation. It explains the conflict between the two factions among the residents of Kansas -- the Jayhawks, who are supporters of the Union, and the Bushwhackers, who are supporters of the Confederacy. It goes on to explain that instead of the groups battling each other with regular armies, they attack each other in guerilla assaults; a particularly brutal form of war that encompasses innocent civilians.
The story begins by introducing Jake Roedel (Tobey Maguire) and Jack Bull Chiles (Skeet Ulrich), who are young men about to be sucked into the developing political situation. Although his father is a German immigrant, Jake identifies himself singularly as an American, and particularly as a patriotic Southern supporter like all his friends. When animosity between the two groups erupts into actual violence, the boys do what honor dictates and join a loosely organized band of Bushwhackers in their grave fight for control of the state.
This much of the narrative is typical of a war story. Naive young men filled with pride and honor are thrust into the hell of war and become little more than cannon fodder. What is unusual is that the story does not attempt to show the protagonists in a positive light. The Bushwhackers are drawn as ruthless terrorists who callously murder and loot innocent civilians. It is not that the opposing side is intended to be more pure, in fact they also commit their share of atrocities. The point is that all war is horrible, but that civil war is especially tragic because it is necessarily cannibalistic, with hatred born of familiarity with and proximity to the enemy.
The story adds extra dimensions by injecting a relationship between Jack and a civilian sympathizer, Sue Lee Shelley (Jewel Kilcher). Another interesting facet is that one member of the Bushwhacker troop, Daniel Holt (Jeffrey Wright), is a black man. Historically, most blacks supported the Union, for obvious reasons, but this story presents the case of one of the very few former slaves who fought for the Confederacy.
Although the film has many compelling issues to work with, it is not a very impressive effort. In order to keep the main character (Jake) likeable, he is never shown to commit any of the brutality of his mates. His distaste of cruelty does not mesh with his willingness to associate with it.
The film is also careless in its presentation. It is jarring to see men who live rough in the brush consistently wearing clean satin vests. Director Ang Lee strives to present vivid and engaging imagery, but some aspects, like the above and the obviously choreographed battles are disingenuously excessive. It is worthy to note that although most of the performances are forgettable, Maguire is successful in presenting a believable character with a charismatic performance.
Marginally recommended. Although it is well paced and cinematically rich, the film is pedestrian because of a weak story. Except for the performance of Tobey Maguire, nothing in the film is noteworthy, yet the film is watchable. The historical component of the film is involving, but the poorly developed story is a detriment to any issues that might be examined.
(c) 2000 Murali Krishnan The Art House Squatter http://ArtHouseSquatter.com
Sent via Deja.com http://www.deja.com/ Before you buy.
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


A Better BibTeX citation:
(crenshaw1989DemarginalizingIntersectionRace?) makes a good case.
This citation should not be found.