text:
#include <boost/test/unit_test.hpp>

#include <string>
#include <vector>

#include "main.h"

// amounts 0.00000001 .. 0.00100000
#define NUM_MULTIPLES_UNIT 100000

// amounts 0.01 .. 100.00
#define NUM_MULTIPLES_CENT 10000

// amounts 1 .. 10000
#define NUM_MULTIPLES_1BTC 10000

// amounts 50 .. 21000000
#define NUM_MULTIPLES_50BTC 420000

using namespace std;

BOOST_AUTO_TEST_SUITE(compress_tests)

bool static TestEncode(uint64 in) {
    return in == CTxOutCompressor::DecompressAmount(CTxOutCompressor::CompressAmount(in));
}

bool static TestDecode(uint64 in) {
    return in == CTxOutCompressor::CompressAmount(CTxOutCompressor::DecompressAmount(in));
}

bool static TestPair(uint64 dec, uint64 enc) {
    return CTxOutCompressor::CompressAmount(dec) == enc &&
           CTxOutCompressor::DecompressAmount(enc) == dec;
}

BOOST_AUTO_TEST_CASE(compress_amounts)
{
    BOOST_CHECK(TestPair(            0,       0x0));
    BOOST_CHECK(TestPair(            1,       0x1));
    BOOST_CHECK(TestPair(         CENT,       0x7));
    BOOST_CHECK(TestPair(         COIN,       0x9));
    BOOST_CHECK(TestPair(      50*COIN,      0x32));
    BOOST_CHECK(TestPair(21000000*COIN, 0x1406f40));

    for (uint64 i = 1; i <= NUM_MULTIPLES_UNIT; i++)
        BOOST_CHECK(TestEncode(i));

    for (uint64 i = 1; i <= NUM_MULTIPLES_CENT; i++)
        BOOST_CHECK(TestEncode(i * CENT));

    for (uint64 i = 1; i <= NUM_MULTIPLES_1BTC; i++)
        BOOST_CHECK(TestEncode(i * COIN));

    for (uint64 i = 1; i <= NUM_MULTIPLES_50BTC; i++)
        BOOST_CHECK(TestEncode(i * 50 * COIN));

    for (uint64 i = 0; i < 100000; i++)
        BOOST_CHECK(TestDecode(i));
}

BOOST_AUTO_TEST_SUITE_END()

redpajama_set_name: RedPajamaGithub


text:
Todd LeDuc advances two positions in Monster Jam Power Rankings
By Dan BeaverFeb 19, 2020, 8:00 PM EST
Neil Elliott held onto the top spot in the Monster Jam Power Rankings, but he has a new driver sniffing his exhaust as Todd Leduc advanced two positions to second this week.
The Stadium Series Green continues to hold the advantage in the Power Rankings with Elliott topping the chart, Morgan Kane in fourth, and Ryan Anderson eighth, but there is an equitable distribution among the other series throughout the field.
Notably, Leduc and his Monster Energy truck in the Stadium Series Red closed the gap with a 38-point overall victory at US Bank Stadium in Minneapolis, MN. Leduc achieved his win through consistency, pocketing the overall without winning a single individual event. Leduc's best session was a second-place finish to Mike Vaters II in Overkill Evolution by .001 points.
Meanwhile on the West Coast, Elliott rambled on. Elliott won his sixth skills challenge in seven contests so far. That contributed to his 35 points for the event at PETCO Park in San Diego and allowed him to hold onto the No. 1 slot in the Monster Jam Power Rankings.
Colton Eichelberger also held station. Third last week, he entered the Rocket Mortgage Fieldhouse on a mission in the Triple Threat Series Central. He topped the event points in all four events with timed race wins in each session, ATV race wins in three of the four, three wins in the speedster obstacle course, two freestyle wins and one win in the donut competitions.
MORE: Ryan Anderson and the anatomy of a Monster Jam freestyle run
Morgan Kane and Grave Digger had a rough night. He was ousted from the racing event in Round 2 by Max-D and Elliott. He failed to win either of the other two competitions of the night and ended with 29 points, which was a distant third to Ryan Anderson's Son-Uva Digger (37) and Max-D (35).
Brandon Vinson moved up to the fifth position with three wins in the Triple Threat Series West. During the weekend he earned seven session wins, including a sweep of the speedster obstacle course and two victories in the two-wheel skills challenge.
Tom Meents debuted on the Monster Jam Power Rankings in 10th by winning the overall in back to back nights of the Stadium Series Yellow. The Saturday show can be seen Feb. 22 at 11:30 p.m. on NBCSN (click here for streaming). The highlight of Meents' weekend were race wins on Saturday and Sunday, defeating Coty Saucier in a Monster Energy truck on Night 1 and Eric Swanson in Obsessed on Night 2.
1. Neil Elliott–same
2. Todd LeDuc–up 2
3. Colton Eichelberger-same
4. Morgan Kane–down 2
5. Brandon Vinson–up 1
6. Tyler Menninga–up 1
7. Coty Saucier–down 2
8. Ryan Anderson–same
9. Linsey Read–up 1
10. Tom Meents-new for 2020
Upcoming TV Schedule (All showings on Eastern time on NBCSN)
Oakland: February 22 (Saturday); 11:30 p.m.
Miami: March 1 (Sunday); 12 a.m.
Jacksonville: March 9 (Monday); 6 p.m.
Detroit: March 21 (Saturday); 11 p.m.
Las Vegas: March 28 (Saturday); 7 p.m.
Santa Clara: April 11 (Saturday); 7 p.m.
Philadelphia: April 17 (Friday); 2:30 p.m.
Denver: April 25 (Saturday); 6:30 p.m.
Monster Jam World Finals Racing: May 9 (Saturday); 5 p.m.
Monster Jam World Finals: May 19 (Tuesday); 4 p.m.
Monster Jam World Freestyle: May 20 (Wednesday); 12 a.m.
Monster Jam World Finals: June 20 (Saturday); 2:30 p.m.

redpajama_set_name: RedPajamaCommonCrawl


text:
So an iPhone user tries out Windows Phone 8.1...
...and comes away impressed by Microsoft's latest mobile OS
Ryan Faas (Computerworld (US)) 09 May, 2014 03:11
AVA Distribution
Bluechip Infotech
CommsPlus Distribution
Dynamic Supplies
Midwich
Westcon – Comstor
Wholesale IT
I like Windows Phone 8.1. I mean I really like it. Even more shocking than that is the fact that most of my experience with the Windows Phone 8.1 preview has been on one of the most bare-bones entry-level Nokia handsets available in the U.S.: the $99 no contract/prepaid Lumia 520 on AT&T. Despite the device's humble specs, the OS runs quite smoothly; the support for existing Windows Phone devices, even low-end devices, is a big contrast to Microsoft's decision to require Windows Phone 7 users to trade up to newer handsets if they wanted Windows Phone 8.
I'll even go so far as to say that I could be quite happy with Windows Phone 8.1 as my primary mobile OS. If an employer were to issue me a Windows Phone device or if the platform was strongly favored over Apple's iOS or Android in a bring-your-own-device program, I'd likely accept the phone and use it daily for work and personal use. I doubt I'd see enough value in carrying around a second smartphone under those circumstances.
As someone who's spent more than a decade writing about Apple technology in business, where iOS maintains a significant lead over the competition, that may sound surprising. But the truth is that Microsoft has finally managed to create a smartphone platform that has the potential to be very competitive, particularly in enterprise environments.
Not the same old Microsoft
I actually acknowledged some of the advantages and the innovation Microsoft delivered in Windows Phone 7 when it launched in 2010. The problem was that while there were a lot of positives about the platform -- the then-new concept of live tiles being one of them -- it was clearly half-baked on arrival, largely didn't integrate with enterprise systems (a major shock), and was very Microsoft-centric when it came to services and apps. In the intervening years, that's largely changed.
The Windows Phone Calendar app showing event data from an iCloud account (light theme).
Microsoft has developed enterprise integration options for Windows Phone and has expanded the management and security capabilities of the platform while also building support into its Enterprise Management Suite (EMS) for other platforms, including iOS and Samsung's KNOX.
One of the most appealing aspects of the platform was the intense effort by Microsoft to support not only its own cloud services like Office 365 and OneDrive, but also cloud and social media accounts from competitors. Nothing illustrates this more than the fact that Windows Phone 8.1 supports syncing of some data -- calendar and contacts -- with Apple's iCloud.
The ability to sync with the dozen or so calendars I have in iCloud, most of them shared with other iOS or Mac users, was my biggest concern about potentially adding a Windows Phone device to my mobile hardware collection. The sync capabilities are also well polished. Events are displayed much as they are on an iOS device (and, quite frankly, I like the Windows Phone calendar better than the iOS 7 calendar app on the iPhone).
Similar levels of integration are offered for other common third-party accounts. The message seems clear: Microsoft would rather you use its services exclusively, and the user experience is weighted to encourage this. But it acknowledges the need to support the ecosystems of its rivals to some degree because it's in a distant third place in both the consumer and business markets.
Windows Phone's competition in the enterprise
Beyond the user experience, Microsoft has some particularly potent advantages in the race for market share in the business world. The biggest is the company's decision to share code across its platforms. This has real significance for enterprise app developers because they can reuse code across Windows 8.x desktop and tablet applications as well as Windows Phone apps and can use the same set of developer tools. That's a powerful incentive for an organization to encourage Windows Phone adoption.
The other advantage is in integration with both new and established Microsoft technology and infrastructure. One of the things that makes the company's EMS proposition so attractive is that it allows IT professionals to use the same tools to manage mobile devices that they use to manage PCs. For organizations that haven't invested in EMS, this could be quite an attractive way to go.
Although Microsoft has advantages, it's difficult to see Windows Phone displacing the iPhone as the corporate or BYOD device of choice in the near term. In most markets, Windows Phone has a minimal market share (though adoption is higher in Europe than the U.S.) and, according to some reports, the platform may have actually lost some market share.
Apple's smartphone market share, on the other hand, is signficant (albeit behind Android in most markets) and the company has been steadily gaining ground. Under Tim Cook's tenure as CEO, Apple has come to focus more and more on the needs of its enterprise customers -- both the individual users and the IT professionals that support them.
With iOS 7, the company signficantly ratcheted up its management and security capabilities, created a new mobile app licensing mechanism, and, in iOS 7.1, introduced a volume configuration and deployment model. That model allows IT to bulk enroll and manage iPhones and iPads without needing to physically work with each device. The company also recently released additional enterprise deployment and security guides for IT teams.
The Email and Accounts section of Windows Phone 8.1 (dark theme).
More recently, Apple highlighted the diversity of enterprise apps in major enterprise companies including Deutsche Bank, Siemens, Eli Lilly and FedEx, each of which had created a dozen or more enterprise iOS apps for employees. That's no small investment and it will almost certainly encourage companies that have adopted iOS to continue to view the platform as their primary mobile OS.
Microsoft could leapfrog over Android in the enterprise
While Apple has managed to carve out a big part of the enterprise mobility market, Android hasn't. Although Android is supported to one extent or another in many workplaces, it presents a unique set of challenges for enterprise IT shops. Most Android devices do not run the most recent, and therefore most secure, version of Android. Because Google allows manufacturers and carriers to control so much of the upgrade process, patches and even whole major releases may never reach some devices, causing a major security concern even when EMS solutions are employed.
EMS should be: EMM (enterprise mobility management) and mobile security solutions are employed.
Android is also not designed to be a closed and secure system like iOS and manufacturers can modify the OS in significant ways. Samsung is trying to use this freedom to create an enterprise-grade version of Android using its KNOX and SAFE programs; other Android manufacturers have made some strides in the same direction. The problem is that manufacturers rely on different security APIs, making consistent universal security and management a challenge.
While it's hard to see Windows Phone grabbing Android's consumer market share, the platform's new level of polish and extended feature set put it on par with iOS and Android. Given the advantages Windows Phone has in the enterprise market -- and the general impression that Android may be too big a challenge to manage effectively -- it's not inconceivable that with enough growth and encouragement from IT, the OS could gain a strong foothold in enterprise organizations and outpace Android adoption over time.
It's also worth noting that, like Apple, Microsoft has kept stricter control of the Windows Phone update process than has Google. That is a major factor and could become even more significant now that Microsoft has completed its acquisition of Nokia's mobile phone business.
Adhering to the mobile-first, cloud-first ethic
Windows Phone 8.1 and Microsoft's EMS, combined with the release of Office for iPad, highlight the company's strategy of being mobile-first and delivering enterprise-grade capabilities across the realistic range of mobile computing in the workplace.Offering a compelling experience, a relatively easy transition from iPhone or Android and a feature-complete mobile OS could help Windows Phone gain the traction that has pretty much eluded the platform since its introduction.
Ryan Faas is a freelance writer and technology consultant specializing in Mac and multiplatform network issues. He has been a Computerworld columnist since 2003 and is a frequent contributor to CITEworld.com. Faas is also the author of iPhone for Work (Apress, 2009). You can find out more about him at RyanFaas.com and follow him on Twitter ( @ryanfaas).
Read more about windows phone in Computerworld's Windows Phone Topic Center.
WatchGuard Boosts Support for ANZ MSPs with the WatchGuardONE program
More from WatchGuard
Tags MicrosoftsmartphonesNokiaAppleiosoperating systemssoftwareconsumer electronicsat&tWindows Phone