%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
Python on Rails - Victory Levy
1. Vic Levy
Princeton Consultants, Inc.
590 5th Ave, Floor 16
New York, NY
vlevy@princeton.com
Python on Rails
Advancing Safety with Locomotive-Hosted
“Mobile” App
NYC Python Meetup, April 17, 2014
Two Sigma Investments, LLC, New York, NY
1
4. PTC is a federal law applying to Amtrak and
Class-I railroads.
CSX is a Class-I railroad.
4
5. 5
• Chatsworth, CA, Sept 2008. Commuter
and freight trains collide, many
casualties
• Federal law passed same month
• Class-1 railroads due Dec 2015
18. COSMA Primary Functions, Cont’d
2. Report on conditions, problems,
assets in the onboard PTC
environment
3. Correct problems, either
autonomously or on command
18
23. Realities of Programming in the
Locomotive Environment
1. No interfering with proper functioning of
safety-critical systems
2. In and out of connectivity
3. No controlled shutdown (circuit breaker)
4. Cell bandwidth is expensive
5. Limited writing to persistent storage (SSD)
23
24. Realities of Programming in the
Locomotive Environment, Cont’d
6. Stay aware of changes in the onboard
environment
• Did we wake up on another locomotive?
• Are we in home territory?
• What is the PTC state?
24
25. Realities of Programming in the
Locomotive Environment, Cont’d
7. Python 2.6.6
8. Red Hat Enterprise Linux Server 6.2
25
26. COSMA Is Multi-Threaded
• Most thread asleep most of the time
• Wake up, check something, go back to sleep
• Signal-mapping watches GPS for distance
26
39. HardwareAccessMethod:
SmartCtl
39
[vlevy@CSX-PTC3EAP-111100016 ~]$ sudo smartctl -a /dev/sda
[sudo] password for vlevy:
smartctl 5.39.1 2010-01-28 r3054 [i386-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Device Model: FiD 2.5 SATA10000
Serial Number: 20111005AAB000000030
Firmware Version: 090928
User Capacity: 7,998,455,808 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Mon Apr 14 15:11:12 2014 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x00) Offline data collection not supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x00) Error logging NOT supported.
No General Purpose Logging support.
SMART Attributes Data Structure revision number: 1280
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 331
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 0
194 Temperature_Celsius 0x0007 032 100 000 Pre-fail Always - 0
229 Unknown_Attribute 0x0002 100 000 000 Old_age Always - 259865206445036
232 Available_Reservd_Space 0x0002 100 048 000 Old_age Always - 9037453799481
233 Media_Wearout_Indicator 0x0002 100 000 000 Old_age Always - 0
234 Unknown_Attribute 0x0002 100 000 000 Old_age Always - 678655194114
235 Unknown_Attribute 0x0002 100 000 000 Old_age Always - 4261534239
Warning: device does not support Error Logging
SMART Error Log Version: 16
No Errors Logged
Warning: device does not support Self Test Logging
SMART Self-test log structure revision number 16
Warning: ATA Specification requires self-test log structure revision number = 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
Device does not support Selective Self Tests/Logging
SSD Statistics:
• Power cycle count
• Erase cycle
percent
• Average & max
erase count
Technique:
• Parse to int
• struct pack &
unpack
49. Princeton Consultants, Inc.
• Blend of information-technology and management consulting
• Service offerings are business strategy, software
development, process engineering and project management
• Clients include many of the best-known and most innovative
companies
• 85 full-time, on-shore professionals work out of our offices in
Princeton, N.J. and Midtown Manhattan
• Over 1,500 projects successfully delivered since our founding
in 1980
• Corporate website: www.princeton.com
• Careers website: www.princeton.com/join
2 Research Way
Princeton, NJ 08540
590 Fifth Avenue
New York, NY 10036