Copy an entire Android Image to multiple devices

first and foremost, let me tell you that i am everything but a professional when it comes to the Android OS. I’ve just been using it casually up to now, but i do have a rather annoying task at hand right now.

The issue i have is Setting up About 150 Android devices, disabling the Google apps, changing some Settings and installing one app. Obviously that task would take about for ever if i did everyting by Hand, so my thought was to just set up one and then copy all the properties and stuff to the other ones. Unfortunately i have no idea if that even is possible.

Rooting the devices is not an Option as the warranty should stay intact. The devices are Zebra TC200J with Android 7.1.2

I’d really appreciate any help about the process or any other ways on how to ease the process. Thanks in advance

Multiple attachment upload causing 409 conflict error. (SPFX, PNP)

I have noticed a bug when using the PnP library for SPFX to upload multiple attachments.

Using: sp-pnp-js@3.0.10 targeting: SharePoint Online

Expected Behavior Question

When uploaded multiple attachments of any size the promise setup up in item.attachmentFiles.addMultiple(attachments) will chain the requests and upload them correctly

Observed Behaviour

When using the item.attachmentFiles.addMultiple(attachments), it is intermittently causing a 409 error due to conflicts in the upload, my research has led me to believe this is caused by one file not being fully uploaded before moving onto the next, in the test case that most commonly causes this the files are approximately 3Mb in size. The error is more likely to occur the more files that are being uploaded. All files uploaded have different names and content.

Upload attachments error

Steps to Reproduce

Files are stored in an array in the state and pulled out and converted into an array of attachments before being uploaded with item.attachmentFiles.addMultiple(attachments) code bellow:

upload attachments method

I am currently working to resolve this issue, any assistance or information from people who have encountered this issue before will be appreciated.

Thank you for your feedback!

Program camera app to take multiple exposures new [duplicate]

This question is an exact duplicate of:

  • Program camera app to take multiple exposures?

I’m trying to create some HDR images by taking photos with multiple exposures. I have the “Kenu Stance” tripod for my Samsung Galaxy S9+, but ultimately, it’s hard to keep the camera 100% steady in between shots as I have to tap the screen to change exposures and, well, it’s a large phone so it will still pivot a bit when touched as the tripod is fixed on a small part of the phone (the USB-C jack). Does anyone know of a way to program the phone/camera app to take three photos in a row, with different settings (like ISO and Shutter speed)? Or perhaps, if there already is a camera app out there that allows this? This way I could just connect my headset to the phone, click the shutter button once and be certain the phone is 100% steady during all the photos.

Need to merge multiple tables from sql

I have multiple tables in DB for a different date for the entire month. I need to merge all the tables in a single file.

File names will be like

Dc_comment_20181101 Dc_comment_20181102 Dc_comment_20181103 Dc_comment_20181104 Dc_comment_20181105 Dc_comment_20181106 Dc_comment_20181107 Dc_comment_20181108

I need to unite all the files, all the files have same column name. My requirement is needed to unite all file. Where file date is different, is there any option to fix the file name as fixed, date as “*”

SELECT column_name(s) FROM table1 UNION ALL SELECT column_name(s) FROM table2;

Instead of typing all the file name, can we fix the file name like “Dc_comment_201811**” in a single query to merge all the table?

Can anyone help on this

Dealing with multiple domains to forward traffic to your FSB store?

Hi there,

is someone using multiple domains to forward traffic to his store? Any insights or doubts on that for sharing with the community?
I now have the chance to grab an aged domain that fits to one of my FSB store topics. Should I just forward it with an open redirect (301) or using a hidden frame forward on the hosting site? And is there a way to figure out the traffic that comes via the new domain? Should I use a html meta-refresh (<meta http-equiv="refresh"…) and track the…

Dealing with multiple domains to forward traffic to your FSB store?

How to make a single dynamic library, .so file from multiple static library .a files

c I have made a DLL in Windows using the functionalities from leptonica (an imaging library) moderate them in my way as required with the attachment of other libraries (zlib, pnglib, jpeglib, jpeg2000, libtiff).

Now I want make the same in Ubuntu, here I have build all of the supporting libraries, and I am stucked at making a single dynamic library file from them as per my requirements, I have wrote a imaging.c file by invoking the functionalities and moderating the outputs as per my requirements from leptonica, and now the problem I am facing to make single dynamic library .so file from it, without any dependencies of the other ones, So that I can use it at any other application at Ubuntu, only by loading a single so file… Also I am facing a lot of permission problem when I am trying to make a thread safe log file from that imaging.c file . Here I am trying to dump a log which will generate from imaging.so when I will call it from any wrapped upper level application..

Excel search formula-return multiple results from a single cell?

Is it possible for the search formula to return multiple records found in a single cell?

For example, if I have the text “Project IDs (222) (333)” in A1, how can I make the following cell return both results found within parentheses?

My current formula which only returns a single first record found of 222, leaving out 333 is:

=MID(A1,SEARCH(“(“,A1)+1,(SEARCH(“)”,A1)-SEARCH(“(“,A1))-1)

Any help would be appreciated.

Help with Multiple Automatic Slideshows – HTML/CSS/JAVA

Hello there,
I am a beginner are web design and am having trouble with a website I am currently building.

I am trying to have multiple, slideshows sit on the page together, and run automatically, but I cannot figure out how to rework the Javascript section. I have also tried the code for multiple sliders on W3schools but it does not work. I have looked at a billion other forums with similar questioning but none help with automatic slideshows or just say that copying the javascript code and…

Help with Multiple Automatic Slideshows – HTML/CSS/JAVA

Multiple file access abstractions – follow-up – redesign

A couple of days ago I asked about an abstraction layer for accessing files (link). There were many great ideas that made me think a lot. The result of it is a complete redesign.

When you think about it, working with files is nothing else but CRUD so by implementing this pattern I was able to solve a lot more problems that I initially intended and the main goal was to have a consistent API for accessing various kinds of resources that must also be dependency-injection-friendly.

This means that I can now create (and already created) abstractions for everything that has some name like:

  • AppSettings ✓
  • ConnectionStrings ✓
  • Physical files ✓
  • Physical directories ✓
  • Embedded files ✓
  • Settings in a database ✓
  • Json resource decorator ✓
  • Environment variables decorator ✓
  • Setting name decorator (for translating Uris to other names) ✓
  • Registry
  • Ftp
  • and what not…

I also think that the best guidelines how to achieve this in such a way that it works for any resource that can be identified by some name are HTTP verbs and up to a certain point REST.

Core

With this in mind I started with the following interface that represents the four main operations as verbs.

[PublicAPI] public interface IResourceProvider {     [NotNull]     ResourceMetadata Metadata { get; }      [ItemNotNull]     Task<IResourceInfo> GetAsync([NotNull] UriString uri, ResourceMetadata metadata = null);      [ItemNotNull]     Task<IResourceInfo> PostAsync([NotNull] UriString uri, [NotNull] Stream value, ResourceMetadata metadata = null);      [ItemNotNull]     Task<IResourceInfo> PutAsync([NotNull] UriString uri, [NotNull] Stream value, ResourceMetadata metadata = null);      [ItemNotNull]     Task<IResourceInfo> DeleteAsync([NotNull] UriString uri, ResourceMetadata metadata = null); } 

The IResourceInfo interface is defined as:

[PublicAPI] public interface IResourceInfo : IEquatable<IResourceInfo>, IEquatable<string> {     [NotNull]     UriString Uri { get; }      bool Exists { get; }      long? Length { get; }      DateTime? CreatedOn { get; }      DateTime? ModifiedOn { get; }      Task CopyToAsync(Stream stream);      Task<object> DeserializeAsync(Type targetType); } 

As you can see it’s using a UriString that a replacement for Uri and that is just a renamed SimpleUri that I asked about here.

The additional property and parameter ResourceMetadata is a DTO for transfering additional information about the request or the provider and is implemented as:

public class ResourceMetadata {     private readonly IImmutableDictionary<SoftString, object> _metadata;      public ResourceMetadata() : this(ImmutableDictionary<SoftString, object>.Empty) { }      private ResourceMetadata(IImmutableDictionary<SoftString, object> metadata) => _metadata = metadata;      public static ResourceMetadata Empty => new ResourceMetadata();      public object this[SoftString key] => _metadata[key];     public int Count => _metadata.Count;     public IEnumerable<SoftString> Keys => _metadata.Keys;     public IEnumerable<object> Values => _metadata.Values;     public bool ContainsKey(SoftString key) => _metadata.ContainsKey(key);     public bool Contains(KeyValuePair<SoftString, object> pair) => _metadata.Contains(pair);     public bool TryGetKey(SoftString equalKey, out SoftString actualKey) => _metadata.TryGetKey(equalKey, out actualKey);     public bool TryGetValue(SoftString key, out object value) => _metadata.TryGetValue(key, out value);      public ResourceMetadata Add(SoftString key, object value) => new ResourceMetadata(_metadata.Add(key, value));       } 

The information that is currently carries is:

public static class ResourceMetadataKeys {     public static string ProviderDefaultName { get; } = nameof(ProviderDefaultName);     public static string ProviderCustomName { get; } = nameof(ProviderCustomName);     public static string CanGet { get; } = nameof(CanGet);     public static string CanPost { get; } = nameof(CanPost);     public static string CanPut { get; } = nameof(CanPut);     public static string CanDelete { get; } = nameof(CanDelete);     public static string Scheme { get; } = nameof(Scheme);     public static string Serializer { get; } = nameof(Serializer); } 

The last one is specifying how a Stream can be de/serialized and is mainly use by the ResourceHelper and testing:

public static class ResourceHelper {     public static (Stream Stream, ResourceMetadata Metadata) CreateStream(object value)     {         // Don't dispose streams. The caller takes care of that.          switch (value)         {             case string s:                 var streamReader = s.ToStreamReader();                 return (streamReader.BaseStream, ResourceMetadata.Empty.Add(Serializer, nameof(StreamReader)));             default:                 var binaryFormatter = new BinaryFormatter();                 var memoryStream = new MemoryStream();                 binaryFormatter.Serialize(memoryStream, value);                 return (memoryStream, ResourceMetadata.Empty.Add(Serializer, nameof(BinaryFormatter)));         }     }      public static object CreateObject(Stream stream, ResourceMetadata metadata)     {         if (metadata.TryGetValue(Serializer, out string serializerName))         {             if (serializerName == nameof(BinaryFormatter))             {                 var binaryFormatter = new BinaryFormatter();                 return binaryFormatter.Deserialize(stream);             }              if (serializerName == nameof(StreamReader))             {                 using (var streamReader = new StreamReader(stream))                 {                     return streamReader.ReadToEnd();                 }             }              throw DynamicException.Create("UnsupportedSerializer", $  "Cannot deserialize stream because the serializer '{serializerName}' is not supported.");         }          throw DynamicException.Create("SerializerNotFound", $  "Serializer wasn't specified.");     } } 

The IResourceProvider has an abstract implementation that I use for adding helper methods:

public abstract class ResourceProvider : IResourceProvider {     public static readonly string Scheme = "ionymous";      protected ResourceProvider(ResourceMetadata metadata)     {         // If this is a decorator then the decorated resource-provider already has set this.         if (!metadata.ContainsKey(ProviderDefaultName))         {             metadata = metadata.Add(ProviderDefaultName, GetType().ToPrettyString());         }          Metadata = metadata;     }      public virtual ResourceMetadata Metadata { get; }      public abstract Task<IResourceInfo> GetAsync(UriString uri, ResourceMetadata metadata = null);      public virtual Task<IResourceInfo> PostAsync(UriString name, Stream value, ResourceMetadata metadata = null) { throw new NotImplementedException(); }      public abstract Task<IResourceInfo> PutAsync(UriString uri, Stream value, ResourceMetadata metadata = null);      public abstract Task<IResourceInfo> DeleteAsync(UriString uri, ResourceMetadata metadata = null);      protected static Exception CreateException(IResourceProvider provider, string name, ResourceMetadata metadata, Exception inner, [CallerMemberName] string memberName = null)     {         return new Exception();     }      protected UriString ValidateScheme([NotNull] UriString uri, string scheme)     {         if (uri == null) throw new ArgumentNullException(nameof(uri));          return             SoftString.Comparer.Equals(uri.Scheme, scheme)                 ? uri                 : throw DynamicException.Create("InvalidScheme", $  "This resource-provider '{GetType().ToPrettyString()}' requires scheme '{scheme}'.");     }      protected UriString ValidateSchemeNotEmpty([NotNull] UriString uri)     {         if (uri == null) throw new ArgumentNullException(nameof(uri));          return             uri.Scheme                 ? uri                 : throw DynamicException.Create("SchemeNotFound", $  "Uri '{uri}' does not contain scheme.");     } } 

Implementations

I use this design in several resource-providers so let me post a couple of them.

The first one, is of course the PhysicalFileProvider. Currently it enforces the Scheme to be file and can perform three of the four verbs. (I future, Post is meant to be implemented as append.)

[PublicAPI] public class PhysicalFileProvider : ResourceProvider {     public static readonly string Scheme = "file";      public PhysicalFileProvider(ResourceMetadata metadata = null)         : base(             (metadata ?? ResourceMetadata.Empty)                 .Add(ResourceMetadataKeys.CanGet, true)                 .Add(ResourceMetadataKeys.CanPut, true)                 .Add(ResourceMetadataKeys.CanDelete, true)                 .Add(ResourceMetadataKeys.Scheme, Scheme)         )     { }      public override Task<IResourceInfo> GetAsync(UriString uri, ResourceMetadata metadata = null)     {         ValidateScheme(uri, Scheme);          return Task.FromResult<IResourceInfo>(new PhysicalFileInfo(uri));     }      public override async Task<IResourceInfo> PutAsync(UriString uri, Stream value, ResourceMetadata metadata = null)     {         ValidateScheme(uri, Scheme);          try         {             using (var fileStream = new FileStream(uri.Path, FileMode.CreateNew, FileAccess.Write))             {                 await value.CopyToAsync(fileStream);                 await fileStream.FlushAsync();             }             return await GetAsync(uri, metadata);         }         catch (Exception inner)         {             throw CreateException(this, uri.Path, metadata, inner);         }      }      public override async Task<IResourceInfo> DeleteAsync(UriString uri, ResourceMetadata metadata = null)     {         ValidateScheme(uri, Scheme);          try         {             File.Delete(uri.Path);             return await GetAsync(uri, metadata);         }         catch (Exception inner)         {             throw CreateException(this, uri.Path, metadata, inner);         }     } }  public static class ResourceProviderExtensions {     public static Task<IResourceInfo> GetFileInfoAsync(this IResourceProvider resourceProvider, string path, ResourceMetadata metadata = null)     {         return resourceProvider.GetAsync($  "file:{path.Replace('\', '/')}", metadata);     } }  [PublicAPI] internal class PhysicalFileInfo : ResourceInfo {     public PhysicalFileInfo([NotNull] UriString uri) : base(uri) { }      public override bool Exists => File.Exists(Uri.Path);      public override long? Length => new FileInfo(Uri.Path).Length;      public override DateTime? CreatedOn => Exists ? File.GetCreationTimeUtc(Uri.Path) : default;      public override DateTime? ModifiedOn => Exists ? File.GetLastWriteTimeUtc(Uri.Path) : default;      public override async Task CopyToAsync(Stream stream)     {         if (Exists)         {             using (var fileStream = File.OpenRead(Uri.Path))             {                 await fileStream.CopyToAsync(stream);             }         }         else         {             throw new InvalidOperationException();         }     }      public override async Task<object> DeserializeAsync(Type targetType)     {         if (Exists)         {             using (var fileStream = File.OpenRead(Uri.Path))             using (var streamReader = new StreamReader(fileStream))             {                 return await streamReader.ReadToEndAsync();             }         }         else         {             throw new InvalidOperationException();         }     } } 

This is how I implemented the EmbeddedFileProvider. This one can only do Get.

public class EmbeddedFileProvider : ResourceProvider {     private readonly Assembly _assembly;      public EmbeddedFileProvider([NotNull] Assembly assembly, ResourceMetadata metadata = null)         : base(             (metadata ?? ResourceMetadata.Empty)                 .Add(ResourceMetadataKeys.CanGet, true)         )     {         _assembly = assembly ?? throw new ArgumentNullException(nameof(assembly));         var assemblyName = _assembly.GetName().Name.Replace('.', '/');         BaseUri = new UriString($  "file:{assemblyName}");     }      public UriString BaseUri { get; }      #region ResourceProvider      public override Task<IResourceInfo> GetAsync(UriString uri, ResourceMetadata metadata = null)     {         ValidateSchemeNotEmpty(uri);          // Embedded resource names are separated by '.' so replace the windows separator.          var fullUri = new UriString(BaseUri, uri.Path.Value);         var fullName = fullUri.Path.Value.Replace('/', '.');          // Embedded resource names are case sensitive so find the actual name of the resource.         var actualName = _assembly.GetManifestResourceNames().FirstOrDefault(name => SoftString.Comparer.Equals(name, fullName));         var getManifestResourceStream = actualName is null ? default(Func<Stream>) : () => _assembly.GetManifestResourceStream(actualName);          return Task.FromResult<IResourceInfo>(new EmbeddedFileInfo(UndoConvertPath(fullName), getManifestResourceStream));     }      public override Task<IResourceInfo> PutAsync(UriString uri, Stream data, ResourceMetadata metadata = null)     {         throw new NotSupportedException($  "{nameof(EmbeddedFileProvider)} does not support value serialization.");     }      public override Task<IResourceInfo> DeleteAsync(UriString uri, ResourceMetadata metadata = null)     {         throw new NotSupportedException($  "{nameof(EmbeddedFileProvider)} does not support value deletion.");     }      #endregion      // Convert path back to windows format but the last '.' - this is the file extension.     private static string UndoConvertPath(string path) => Regex.Replace(path, @"\.(?=.*?\.)", Path.DirectorySeparatorChar.ToString()); }  internal class EmbeddedFileInfo : ResourceInfo {     private readonly Func<Stream> _getManifestResourceStream;      public EmbeddedFileInfo(string uri, Func<Stream> getManifestResourceStream) : base(uri)     {         _getManifestResourceStream = getManifestResourceStream;     }      public override bool Exists => !(_getManifestResourceStream is null);      public override long? Length     {         get         {             using (var stream = _getManifestResourceStream?.Invoke())             {                 return stream?.Length;             }         }     }      public override DateTime? CreatedOn { get; }      public override DateTime? ModifiedOn { get; }       public override async Task CopyToAsync(Stream stream)     {         if (Exists)         {             using (var resourceStream = _getManifestResourceStream())             {                 await resourceStream.CopyToAsync(stream);             }         }         else         {             throw new InvalidOperationException();         }     }      public override async Task<object> DeserializeAsync(Type targetType)     {         using (var resourceStream = _getManifestResourceStream())         using (var streamReader = new StreamReader(resourceStream))         {             return await streamReader.ReadToEndAsync();         }     } } 

And as the last example the AppSettingProvider form another project that is now also built on top of IResourceProvider:

using static ResourceMetadataKeys;  public class AppSettingProvider : ResourceProvider {     public AppSettingProvider()         : base(             ResourceMetadata.Empty                 .Add(CanGet, true)                 .Add(CanPut, true)         )     { }      public override Task<IResourceInfo> GetAsync(UriString uri, ResourceMetadata metadata = null)     {         var settingName = new SettingName(uri);         var exeConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);         var actualKey = FindActualKey(exeConfig, settingName) ?? settingName;         var element = exeConfig.AppSettings.Settings[actualKey];         return Task.FromResult<IResourceInfo>(new AppSettingInfo(uri, element?.Value));     }      public override async Task<IResourceInfo> PutAsync(UriString uri, Stream stream, ResourceMetadata metadata = null)     {         using (var valueReader = new StreamReader(stream))         {             var value = await valueReader.ReadToEndAsync();              var settingName = new SettingName(uri);             var exeConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);             var actualKey = FindActualKey(exeConfig, settingName) ?? settingName;             var element = exeConfig.AppSettings.Settings[actualKey];              if (element is null)             {                 exeConfig.AppSettings.Settings.Add(settingName, (string)value);             }             else             {                 exeConfig.AppSettings.Settings[actualKey].Value = (string)value;             }              exeConfig.Save(ConfigurationSaveMode.Minimal);              return await GetAsync(uri);         }     }      public override Task<IResourceInfo> DeleteAsync(UriString uri, ResourceMetadata metadata = null)     {         throw new NotImplementedException();     }      [CanBeNull]     private static string FindActualKey(System.Configuration.Configuration exeConfig, string key)     {         return             exeConfig                 .AppSettings                 .Settings                 .AllKeys                 .FirstOrDefault(k => SoftString.Comparer.Equals(k, key));     } }  internal class AppSettingInfo : ResourceInfo {     [CanBeNull]     private readonly string _value;      internal AppSettingInfo([NotNull] UriString uri, [CanBeNull] string value) : base(uri)     {         _value = value;     }      public override bool Exists => !(_value is null);      public override long? Length => _value?.Length;      public override DateTime? CreatedOn { get; }      public override DateTime? ModifiedOn { get; }      public override async Task CopyToAsync(Stream stream)     {         if (Exists)         {             // ReSharper disable once AssignNullToNotNullAttribute - this isn't null here             using (var valueStream = _value.ToStreamReader())             {                 await valueStream.BaseStream.CopyToAsync(stream);             }         }     }      public override Task<object> DeserializeAsync(Type targetType)     {         return Task.FromResult<object>(_value);     } } 

So, how do you like it and how would you improve it? There are not many properties and some things are hidden inside ResourceMetadata but with a single API for everything you must make some tradeoffs. I find works surprisingly well.

(In future, when I will need for such nichts as Ftp, I will add a new API to the ResourceProvider that I will probably call BeginScope/Session to be able to work with sessions.)

I call it IOnymous and the complete code is as always on GitHub in the experimental branch.