Skip to content

Commit 796e4f9

Browse files
author
Ori Levari
authored
Various bug fixes and build features to public samples (#203)
1 parent 835513d commit 796e4f9

26 files changed

+220
-113
lines changed

Samples/AdapterSelection/AdapterSelection/cpp/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ int main(int argc, char* argv[])
6363
// user selects adapter
6464
printf("Please enter the index of the adapter you want to use...\n");
6565
int selectedIndex;
66-
while (!(cin >> selectedIndex) || selectedIndex < 0 || selectedIndex >= static_cast<int>(validAdapters.size())) {
66+
cin >> selectedIndex;
67+
while (selectedIndex < 0 || selectedIndex >= static_cast<int>(validAdapters.size())) {
6768
cin.clear();
6869
cin.ignore(numeric_limits<streamsize>::max(), '\n');
6970
printf("Invalid index, please try again.\n");
71+
cin >> selectedIndex;
7072
}
7173
printf("Selected adapter at index %d\n", selectedIndex);
7274

Samples/CustomTensorization/CustomTensorization/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,12 @@ void SaveOutputToDisk(
163163
std::wstring outputPath = modulePath;
164164
std::wstring filename{ TensorizationHelper::GetFileName() };
165165
int32_t i = modulePath.find(filename);
166+
166167
if (i != std::wstring::npos) {
167-
outputPath = outputPath.substr(0, i + wcslen(filename.c_str())) + L"\\" + filename + L"\\";
168+
StorageFolder parentFolder = StorageFolder::GetFolderFromPathAsync(outputPath.substr(0, i + wcslen(filename.c_str()))).get();
169+
if (parentFolder.TryGetItemAsync(filename).get() != nullptr) {
170+
outputPath = outputPath.substr(0, i + wcslen(filename.c_str())) + L"\\" + filename + L"\\";
171+
}
168172
}
169173

170174
StorageFolder currentfolder = StorageFolder::GetFolderFromPathAsync(outputPath).get();

Samples/Emoji8/UWP/cs/Emoji8/Emoji8.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
20-
<PackageCertificateKeyFile>Emoji_TemporaryKey.pfx</PackageCertificateKeyFile>
21-
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
22-
<AppxBundle>Always</AppxBundle>
20+
<PackageCertificateKeyFile>Emoji8_TemporaryKey.pfx</PackageCertificateKeyFile>
21+
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
22+
<AppxBundle>Never</AppxBundle>
2323
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
24-
<PackageCertificateThumbprint>319D19788E0D363D117116248BEB1C90C9C6B4F1</PackageCertificateThumbprint>
24+
<PackageCertificateThumbprint>AEF8CDB5C6F65B590EC236F9692BB1BB89BEDA51</PackageCertificateThumbprint>
2525
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
2626
<AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
2727
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
@@ -129,8 +129,7 @@
129129
<AppxManifest Include="Package.appxmanifest">
130130
<SubType>Designer</SubType>
131131
</AppxManifest>
132-
<None Include="cert.pfx" />
133-
<None Include="Emoji_TemporaryKey.pfx" />
132+
<None Include="Emoji8_TemporaryKey.pfx" />
134133
<Content Include="Assets\emoji8.png" />
135134
<Content Include="Assets\emoji8Small.png" />
136135
<Content Include="Assets\LargeTile.scale-100.png" />
2.45 KB
Binary file not shown.
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3-
<Identity Name="Microsoft.Emoji8" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.0.29.0" />
4-
<mp:PhoneIdentity PhoneProductId="b453530a-3933-419b-98d9-1b52e2b63bee" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
5-
<Properties>
6-
<DisplayName>Emoji8</DisplayName>
7-
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
8-
<Logo>Assets\StoreLogo.png</Logo>
9-
</Properties>
10-
<Dependencies>
11-
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
12-
</Dependencies>
13-
<Resources>
14-
<Resource Language="x-generate" />
15-
</Resources>
16-
<Applications>
17-
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Emoji.App">
18-
<uap:VisualElements DisplayName="Emoji8" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Emoji" BackgroundColor="white">
19-
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
20-
</uap:DefaultTile>
21-
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="white" />
22-
</uap:VisualElements>
23-
</Application>
24-
</Applications>
25-
<Capabilities>
26-
<Capability Name="internetClient" />
27-
<DeviceCapability Name="webcam" />
28-
</Capabilities>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3+
<Identity Name="Microsoft.Emoji8" Publisher="CN=winml" Version="1.0.0.0" />
4+
<mp:PhoneIdentity PhoneProductId="b453530a-3933-419b-98d9-1b52e2b63bee" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
5+
<Properties>
6+
<DisplayName>Emoji8</DisplayName>
7+
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
8+
<Logo>Assets\StoreLogo.png</Logo>
9+
</Properties>
10+
<Dependencies>
11+
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
12+
</Dependencies>
13+
<Resources>
14+
<Resource Language="x-generate" />
15+
</Resources>
16+
<Applications>
17+
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Emoji.App">
18+
<uap:VisualElements DisplayName="Emoji8" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Emoji" BackgroundColor="white">
19+
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
20+
</uap:DefaultTile>
21+
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="white" />
22+
</uap:VisualElements>
23+
</Application>
24+
</Applications>
25+
<Capabilities>
26+
<Capability Name="internetClient" />
27+
<DeviceCapability Name="webcam" />
28+
</Capabilities>
2929
</Package>

Samples/FNSCandyStyleTransfer/UWP/cs/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3-
<Identity Name="257918C9-ABE3-483E-A202-C5C69AEBD825" Publisher="CN=winml" Version="1.1.36.0" />
3+
<Identity Name="257918C9-ABE3-483E-A202-C5C69AEBD825" Publisher="CN=winml" Version="1.0.0.0" />
44
<mp:PhoneIdentity PhoneProductId="3bd922b5-d779-4208-8c35-aec4dea61330" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
55
<Properties>
66
<DisplayName>Shortcut</DisplayName>

Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
2020
<PackageCertificateKeyFile>SnapCandy_TemporaryKey.pfx</PackageCertificateKeyFile>
21-
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
22-
<AppxBundle>Always</AppxBundle>
21+
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
22+
<AppxBundle>Never</AppxBundle>
2323
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
24-
<PackageCertificateThumbprint>6D23597D1B6024B45E38A0762F178A76CE73B1B2</PackageCertificateThumbprint>
24+
<PackageCertificateThumbprint>71864B33C72C34F3EC08C77989B2DE1D92E780A5</PackageCertificateThumbprint>
25+
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
26+
<AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
27+
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
2528
</PropertyGroup>
2629
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2730
<DebugSymbols>true</DebugSymbols>
2.45 KB
Binary file not shown.
2.45 KB
Binary file not shown.

Samples/MNIST/UWP/cppcx/mnist_cppcx.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Global
1818
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|ARM.ActiveCfg = Debug|ARM
1919
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|ARM.Build.0 = Debug|ARM
2020
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|ARM.Deploy.0 = Debug|ARM
21-
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.ActiveCfg = Debug|Win32
22-
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.Build.0 = Debug|Win32
23-
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.Deploy.0 = Debug|Win32
21+
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.ActiveCfg = Debug|x64
22+
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.Build.0 = Debug|x64
23+
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x64.Deploy.0 = Debug|x64
2424
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x86.ActiveCfg = Debug|Win32
2525
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x86.Build.0 = Debug|Win32
2626
{8B9EC025-3997-48E1-8670-07937D7856DB}.Debug|x86.Deploy.0 = Debug|Win32

0 commit comments

Comments
 (0)