Shor's algorithm is for quantum computer. Using this algorithm any arbitrarily large number can be factored in polynomial time. which is not possible in classical computer
Advanced cgroups and namespaces
This talk picks up where we left off in the previous cgroups and namespaces talk and dive in even deeper!
Agenda:
* cgroups v2 design (cgroup v2 was started to be merged in the current kernel, 4.4)
* cgroups v2 examples (migrating tasks, enabling and disabling controllers, and more).
* comparison between cgroup v2 unified hierarchy and cgroup v1 legacy hierarchy.
* PIDs namespaces (from kernel 4.3)
* cgroup namespaces (not merged yet)
In this deck from the Argonne Training Program on Extreme-Scale Computing 2019, Jonathan Baker from the University of Chicago presents: Quantum Computing: The Why and How.
"Jonathan Baker is a second year Ph.D student at The University of Chicago advised by Fred Chong. He is studying quantum architectures, specifically how to map quantum algorithms more efficiently to near term devices. Additionally, he is interested in multivalued logic and taking advantage of quantum computing’s natural access to higher order states and using these states to make computation more efficient. Prior to beginning his Ph.D., he studied at the University of Notre Dame where he obtained a B.S. of Engineering in computer science and a B.S. in Chemistry and Mathematics."
Watch the video: https://wp.me/p3RLHQ-l1i
Learn more: https://extremecomputingtraining.anl.gov/
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
Shor's algorithm is for quantum computer. Using this algorithm any arbitrarily large number can be factored in polynomial time. which is not possible in classical computer
Advanced cgroups and namespaces
This talk picks up where we left off in the previous cgroups and namespaces talk and dive in even deeper!
Agenda:
* cgroups v2 design (cgroup v2 was started to be merged in the current kernel, 4.4)
* cgroups v2 examples (migrating tasks, enabling and disabling controllers, and more).
* comparison between cgroup v2 unified hierarchy and cgroup v1 legacy hierarchy.
* PIDs namespaces (from kernel 4.3)
* cgroup namespaces (not merged yet)
In this deck from the Argonne Training Program on Extreme-Scale Computing 2019, Jonathan Baker from the University of Chicago presents: Quantum Computing: The Why and How.
"Jonathan Baker is a second year Ph.D student at The University of Chicago advised by Fred Chong. He is studying quantum architectures, specifically how to map quantum algorithms more efficiently to near term devices. Additionally, he is interested in multivalued logic and taking advantage of quantum computing’s natural access to higher order states and using these states to make computation more efficient. Prior to beginning his Ph.D., he studied at the University of Notre Dame where he obtained a B.S. of Engineering in computer science and a B.S. in Chemistry and Mathematics."
Watch the video: https://wp.me/p3RLHQ-l1i
Learn more: https://extremecomputingtraining.anl.gov/
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
In this deck from the HPC User Forum in Tucson, John Martinis from Google presents: Quantum Computing and Quantum Supremacy.
Google recently announced that the company has developed a new 72-Qbit quantum processor called Bristlecone.
"The goal of the Google Quantum AI lab is to build a quantum computer that can be used to solve real-world problems. Our strategy is to explore near-term applications using systems that are forward compatible to a large-scale universal error-corrected quantum computer. In order for a quantum processor to be able to run algorithms beyond the scope of classical simulations, it requires not only a large number of qubits. Crucially, the processor must also have low error rates on readout and logical operations, such as single and two-qubit gates."
Watch the video: https://wp.me/p3RLHQ-ipZ
Learn more: https://research.googleblog.com/2018/03/a-preview-of-bristlecone-googles-new.html
and
htttp://hpcuserforum.com
Lattice-Based Cryptography: CRYPTANALYSIS OF COMPACT-LWEPriyanka Aash
Destructive and constructive methods in lattice-based cryptography will be discussed. Topic 1: Cryptanalysis of Compact-LWE Authors: Jonathan Bootle; Mehdi Tibouchi; Keita Xagawa Topic 2: Two-message Key Exchange with Strong Security from Ideal Lattices Authors: Zheng Yang; Yu Chen; Song Luo
(Source: RSA Conference USA 2018)
this is about international data encryption algorithm. this is first ever ppt which includes its history, encryption , figure, decryption and application.. do share ur views after viewing it if u like..
Module 1: Introduction to Cryptography and Symmetric Key Ciphers
Computer Security Concepts - OSI Security Architecture -Security Attacks - Services, Mechanisms -
Symmetric Cipher Model - Traditional Block Cipher Structure - The Data Encryption Standard -The Strength of DES - Advanced Encryption Standard.
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
In this talk Jiří Pírko discusses the design and evolution of the VLAN implementation in Linux, the challenges and pitfalls as well as hardware acceleration and alternative implementations.
Jiří Pírko is a major contributor to kernel networking and the creator of libteam for link aggregation.
KRACK attack is one of the most famous one in WiFi security and privacy. In this presentation a detailed description of the attack is considered and countermeasures are offered.
My slideshow examines the ethics of eating meat, and how it contributes to poor health in humans and animals, as well as the pollution of our environment. It also identifies the benefits of choosing a vegetarian diet.
In this deck from the HPC User Forum in Tucson, John Martinis from Google presents: Quantum Computing and Quantum Supremacy.
Google recently announced that the company has developed a new 72-Qbit quantum processor called Bristlecone.
"The goal of the Google Quantum AI lab is to build a quantum computer that can be used to solve real-world problems. Our strategy is to explore near-term applications using systems that are forward compatible to a large-scale universal error-corrected quantum computer. In order for a quantum processor to be able to run algorithms beyond the scope of classical simulations, it requires not only a large number of qubits. Crucially, the processor must also have low error rates on readout and logical operations, such as single and two-qubit gates."
Watch the video: https://wp.me/p3RLHQ-ipZ
Learn more: https://research.googleblog.com/2018/03/a-preview-of-bristlecone-googles-new.html
and
htttp://hpcuserforum.com
Lattice-Based Cryptography: CRYPTANALYSIS OF COMPACT-LWEPriyanka Aash
Destructive and constructive methods in lattice-based cryptography will be discussed. Topic 1: Cryptanalysis of Compact-LWE Authors: Jonathan Bootle; Mehdi Tibouchi; Keita Xagawa Topic 2: Two-message Key Exchange with Strong Security from Ideal Lattices Authors: Zheng Yang; Yu Chen; Song Luo
(Source: RSA Conference USA 2018)
this is about international data encryption algorithm. this is first ever ppt which includes its history, encryption , figure, decryption and application.. do share ur views after viewing it if u like..
Module 1: Introduction to Cryptography and Symmetric Key Ciphers
Computer Security Concepts - OSI Security Architecture -Security Attacks - Services, Mechanisms -
Symmetric Cipher Model - Traditional Block Cipher Structure - The Data Encryption Standard -The Strength of DES - Advanced Encryption Standard.
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
In this talk Jiří Pírko discusses the design and evolution of the VLAN implementation in Linux, the challenges and pitfalls as well as hardware acceleration and alternative implementations.
Jiří Pírko is a major contributor to kernel networking and the creator of libteam for link aggregation.
KRACK attack is one of the most famous one in WiFi security and privacy. In this presentation a detailed description of the attack is considered and countermeasures are offered.
My slideshow examines the ethics of eating meat, and how it contributes to poor health in humans and animals, as well as the pollution of our environment. It also identifies the benefits of choosing a vegetarian diet.
Gary Tarolli's presentation on April 27, 2015 to the Computer Systems Fundamentals class at Middlesex Community College. A great perspective on the history of graphics and Gary's unique role in groundbreaking companies like 3dfx and nvidia.
Blockchain workshop PwC March 2018. Explanation of bitcoin and blockchain, Historical analogies, pros and cons, examlples. (Slides don't tell the full story, it included hands on activtiies)
Undefined behavior is closer than you thinkAndrey Karpov
Some people think that undefined behavior is caused only by gross errors (accessing outside the bounds of the array, for instance) or inadequate constructions (i = i++ + ++i, for example). That's why it is quite surprising when a programmer sees undefined behavior in the code that used to work correctly, without arousing any suspicion. One should never let his guard down, programming in C/C++. Because hell is closer than you may think.
Também conhecido como o “Time Lock Puzzle”, o LCS35 é um desafio em forma de criptografia projetado em 1999 pelo pesquisador Ron Rivest, do Instituto de Tecnologia de Massachusetts (MIT). Quando este problema matemático for resolvido, uma cápsula do tempo de chumbo será aberta no MIT.
O puzzle envolve a divisão de um número incrivelmente enorme, por um número que é apenas um pouco menor que o da conta (mas ainda com mais de 600 dígitos).
Ninguém sabe o que está dentro da capsula e, segundo os dados de Rivest, estima-se que levaria cerca de 35 anos para que o enigma seja resolvido. Os interessados ainda terão de esperar para descobrir o que de fato tem na capsula.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
31. No car
Normally Perl lets us forget that we're running software on actual silicon
But hardware has limits.
And this is because of...
32. ...or whatever the C folks say.
Perl is supposed to shield us from all that.
But sometimes it doesn't.
33. 32 bit signed double
floating point static
registers
...or whatever the C folks say.
Perl is supposed to shield us from all that.
But sometimes it doesn't.
34. 32 bit signed integer
31 bits for the integer
1 bit for the sign
48. 2147483647 + 1
Text
==
-2147483648
Of course.
Therefore...
49. $ perl -wle 'print scalar gmtime(2**31)'
Fri Dec 13 20:45:52 1901
...you got exactly what you asked for.
And BTW, you should be using a 64 bit clean machine.
58. A number is a number.
(Perl is a closet Ayn Rand fan)
I don't care how it's represented internally
Perl gives no indication how it's represented internally.
There's no reason a Perl programmer can suspect there's any limits.
So we have to fix this.
69. 1941, arsenal of democracy
Apparently Picassa doesn't do anything before 1970!
70. April 20th, 1975
167,220,000 seconds
The most important date in my life.
I was born.
Fortunately after the Unix epoch.
Some people were born before 1970.
Some systems can't handle negative times.
Windows can't.
71. 5.6.1
2001-Apr-08
How many people here are still using (or know someone using) 5.6?
Seven years from now, people will still be using 5.10.
They will still be using 32 bit machines.
Or 64 bit machines with 32 bit time_t.
72. 5.6.1
2001-Apr-08
(Seven Years Ago)
How many people here are still using (or know someone using) 5.6?
Seven years from now, people will still be using 5.10.
They will still be using 32 bit machines.
Or 64 bit machines with 32 bit time_t.
73. 29 - 7
==
Let's do the math...
In 2015, with 22 years to go, people will likely still be using 5.10.0
How many people have a 20 year mortgage?
So we'd better fix this NOW
74. 29 - 7
==
22
Let's do the math...
In 2015, with 22 years to go, people will likely still be using 5.10.0
How many people have a 20 year mortgage?
So we'd better fix this NOW
75. 29 - 7
==
22
(2015)
Let's do the math...
In 2015, with 22 years to go, people will likely still be using 5.10.0
How many people have a 20 year mortgage?
So we'd better fix this NOW
80. We'll all upgrade to 64 bit!
And if you use Linux, and use a 64 bit distribution, that's fine.
How many Macs out there?
New Macs use 64 bit processors.
They do not use a 64 bit time_t.
Why?
81. 00000001 1
7FFFFFFF 2147483647
80000000 -2147483648
32bits x 3 == 96 bits
Computers store numbers in a fixed size.
Storing 3 32 bit numbers is 96 bits
82. 0000000000000001 1
000000007FFFFFFF 2147483647
7FFFFFFFFFFFFFFF 9223372036854775807
64bits x 3 == 192 bits
(the embarassing part is I had to calculate that in Ruby)
But 3 64 bit integers is 192 bits
This means the same binary program can't run on a 32 and a 64 bit machine.
Linux users are used to recompiling and multiple distributions
Apple and Windows users aren't.
Apple has clever ways to deal with this
Did it for Motorola -> PPPC, PPC -> Intel
but they didn't think it's worth the effort
Why?
83. Windows tried it.
Most PCs these days use a 64 bit processor.
Nobody uses 64 bit Windows
People are really bad about keeping their types straight
Assume that an integer is 32 bit and such.
84. And, of course, not everyone is going to upgrade their hardware.
Really what quot;let's all upgrade to 64 bitquot; is saying is...
85.
86.
87. Don't use the built-ins, use DateTime!
Yes, DateTime is fantastic, but a lot of things depend on the built-ins.
And a lot of other languages and projects depend on localtime and gmtime
C, Python, Perl and Ruby all make use of it.
And leaving the built-ins broken leaves Perl with no built in safe date handling.
We could suck in DateTime, but there's a problem with that I'll get to in a moment.
This is special case of the...
88. Just use <insert library here>
libtai is one
It's fast
It's reliable
It avoids the 2038 problem...
It doesn't do time zones.
89. Time zones are important
Time zones are insane
Time zones change
Oh, and there's daylight savings time
All this information is in your operating system's time zone database.
It gets updated along with the operating system.
There is no portable API to the OS' time zone database.
Things like DateTime ship their own time zone database.
But that's a lot of work.
And now you have two time zone databases to keep up to date.
(That you probably don't know exist)
90. # From Paul Eggert (2001-03-06):
# Daylight Saving Time was first
# suggested as a joke by Benjamin Franklin
# in his whimsical essay ``An Economical
# Project for Diminishing the Cost
# of Light'' published in the Journal
# de Paris (1784-04-26).
92. (b) Effective Date.--Subsection
(a) shall take effect 1 year after
the date of enactment of this Act
or March 1, 2007, whichever is
later.
So we had about a year to adjust all the computers to match.
Probably cost far more money and energy than it saved.
93. SEC. 110. DAYLIGHT SAVINGS.
(a) Amendment.--Section 3(a) of the Uniform Time Act of
1966 (15 U.S.C. 260a(a)) is amended--
(1) by striking ``first Sunday of April''
and inserting ``second Sunday of March''; and
(2) by striking ``last Sunday of October'' and
inserting ``first Sunday of November''.
94. (c) Report to Congress.--Not later than
9 months after the effective date stated in
subsection (b), the Secretary shall report
to Congress on the impact of this section on
energy consumption in the United States.
95. (d) Right to Revert.--Congress
retains the right to revert the
Daylight Saving Time back to the 2005
time schedules once the Department
study is complete.
So we might have to put it right back!
96. A) Handle time zones
b) Use the system tz database
3) Be portable (ANSI C 89)
iv) Compatible license w/Perl
É) localtime/gmtime compatible
Nothing exists.
97. A) Handle time zones
b) Use the system tz database
GIVEN
No tz database API
This seems impossible.
Well, I lied. There is, sort of.
98. date = localtime(time);
time = mktime(date);
ANSI C 89 has two functions which talk to the time zone database.
This is the wedge we'll use
mktime() is the inverse of localtime()
100. Step 1:
Write 64 bit gmtime()
And that's relatively easy. It's just a bunch of math.
Perl already detects a native 64 bit integer type (Quad_t).
quot;Easyquot; because writing ANSI C 89 is hard.
But if strings aren't involved it's fine.
101. Step 2:
...
Before we get into step 2
Let's talk about calendars.
102. The calendar we all think we use is the Julian Calendar, introduced in the west in 46 BC
by Julius Caesar
It estimates that a year is 365 1/4 days.
Thus a leap year every 4 years.
This is slightly wrong, but we'll get to that.
Looking at on a calendar, there are two important attributes.
119. | 0 | 2 | 3 | 4 |
| 5 | 0 | 1 | 2 |
| 3 | 5 | 6 | 0 |
| 1 | 3 | 4 | 5 |
| 6 | 1 | 2 | 3 |
| 4 | 6 | 0 | 1 |
| 2 | 4 | 5 | 6 |
It turns out you just add 16 to the year to adjust for exceptional centuries
There's a little more numerology, but that's the hack.
120. # Get date in GMT
$date = gmtime64($time);
my $real_year = $date->{year};
# Map GMT year to 1970-2038
$date->{year} = safe_year($real_year);
# Get the epoch time for that
my $safe_time = timegm($date);
# Then the localized date
$safe_date = localtime($safe_time);
# Map the date forward again
$safe_date->{year} = $real_year;
That's the basic algorithm.
There's some issues around the new year.
gmtime Jan 1st might be Dec 31 in the local zone
121. How accurate is this?
Calculating future local times is always dicey, the rules might change.
Past local times will become less accurate, but at a certain point the time zone simply no
longer exists. What's does Eastern Standard Time mean in 1589?
The real danger is mapping near future dates to a point just before the rules changed.
As we get closer to 2038 the problem will become more acute.
So at worst you'll be off by an hour or two.
122. $ perl -wle 'print scalar gmtime 2**31-1'
Tue Jan 19 03:14:07 2038
$ perl -wle 'print scalar gmtime 2**31'
Fri Dec 13 20:45:52 1901
This is better than being off by 138 years.
130. Time::Local::Extended
Older module
Did a similar hack with localtime, but without the careful year mapping (just subtracted 60
years).
Hopefully the patched version will be released soon.
There's a patch on y2038.
You can use that to make your Perl code y2038 safe.
131. use Time::Local::Extended;
print scalar gmtime(2**31);
print scalar localtime(2**31);
# Tue Jan 19 03:14:08 2038
# Mon Jan 18 22:14:08 2038
Does timelocal() and timegm() too.
How far does it go?
For practical purposes, it can do about 142 million years accurately.
132. use Time::Local::Extended;
print scalar localtime 2**52;
print scalar localtime -2**52;
# Fri Dec 5 22:48:16 142715360
# Mon Jan 25 15:11:44 -142711421
This is because Perl has no portable 64 bit integer scalar type.
(I hope to fix that)
So it has to use double floats which are accurate to 2**52.
After that it loses accuracy.
How far can it go?
133. $ ./perl -wle 'print scalar gmtime 2**63-513'
Sun Dec 4 15:13:04 292277026596
That -513 is because of floating point error.
135. 13.7 billion years
(age of the universe)
So it gives us some room to work.
136. Once you break the 2038 barrier you start to run into new problems.
137. date.tm_year // integer
The struct in which C stores the year is defined to be an integer.
This leads to the...
138. y2,147,483,648 bug
y2 billion bug
Have to be careful to store the year as a 64 bit int.
Many 64 operating systems miss this.
y2038 defines its own Year type to help with that.
So time64.h has the option of using a y2 billion safe time struct.
bleadperl uses that.
139. y3001 bug
Windows' C functions have a y3001 bug, I have no idea why.
y2038 gets around that
143. If you ask a historian
They'll say quot;there is no year zeroquot;
144. 1 BC + 1 year = 1 AD
And historians are fine with this
Because they still do their work on scrolls
And it's not an exact science
And being a year off isn't too important
This is also why 2001 is the quot;real millenniumquot;.
For math and computers, the discontinuity is difficult.
This sucks.
So what does the Gregorian calendar say?
147. Values in the range [0000] through [1582]
shall only be used by mutual agreement of
the partners in information interchange.
Which is ISO-speak for quot;we couldn't decidequot;
But they do have a year 0 and they have the best cop out.
149. ...the second year before the year [0000]
So what's year zero?
It's the year before year one.
So simple!
150. Turns out, this is how astronomers do it.
They're the only people who need to worry about really long dates
And do a lot of math where being one year off matters.
155. http://y2038.googlecode.com/
The project needs help.
I'm the only developer.
I'm not a C programmer.
Only a handful of time.h functions have been implemented.
Python needs a lot more.
If you're a C programmer, or want to learn, please sign up.
There's a user's list. I'm liberal with handing out commit bits.
Be bold.