Urgent.News

What's breaking now, across thousands of outlets.

Tech

Start and End Dates of the Longest Rising Period

Problem Description The stock table records the daily closing prices of many stocks, with the fields CODE (stock code), DT (trading date) and CL (closing price). For a given target stock, find the period during which it rose for the largest number of consecutive days, and give the start date and end date of that period. Source Data stock table (only the records of the target stock CODE = 100046…

The task at hand is to identify the period when the specified stock (CODE 100046) consistently rose for the most consecutive trading days. To accomplish this, the data must be filtered to include only the records for this stock, sorted chronologically by trading date, and then segmented into intervals where the closing price does not fall.

The interval starts anew whenever the closing price declines from the previous day's level. As each interval is identified, the algorithm assigns it a unique group number, which remains constant for all days within that uninterrupted ascent. At the conclusion of each interval, the count of days included in that particular rising sequence is recorded.

The longest sequence is then pinpointed by comparing these day counts, and the start and end dates corresponding to this longest uninterrupted rise are extracted.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Why Java is Still the Quiet Engine of the Web (And Why It’s Not Going Anywhere)

There’s a long-running running joke in developer circles that Java is the "dinosaur" of modern programming languages. It’s heavy, it’s verbose, and everyone seems to move on to whatever lightweight…

  • Java powers millions of transactions per second in finance and e-commerce
  • JVM enables write-once, run-anywhere code across platforms
  • Recent Java 8+ features streamline high-concurrency programming

How to secure a Spring Security client application with OIDC (using pac4j)

If you already have Spring Security in your application, with hasRole rules, @PreAuthorize on services and code reading SecurityContextHolder and you want to add an OpenID Connect login, while keeping…

  • Set up Maven project with Spring Boot and Spring Security
  • Add pac4j dependencies for OIDC authentication in pom.xml
  • Configure Pac4j by creating Pac4jConfig.java with OidcClient bean

I Built CouponLab with AI Help. The Coupon Codes Still Have to Survive Checkout.

There’s a very specific kind of optimism involved in copying a coupon code. You see “20% off.” You picture the cheaper total. You paste the code.

  • Author built CouponLab to help users find and understand coupon codes.
  • AI assists in discovering offers, while author verifies coupon codes.
  • Design focuses on presenting relevant information without overwhelming users.

More from Thursday 8 October →