33 questions
1
vote
0
answers
963
views
PowerShell 7 - Invoke-WebRequest - use form parameter to send byte array as file
My Powershell 7 script reads JPG files from a content service.
$fetch = @{
Uri = 'https://content.site/media?id=82348'
Method = GET
}
$fetchResponse = Invoke-WebRequest @fetch
Image data loads ...
0
votes
1
answer
500
views
Powershell parsing system.array - netsh wlan show profiles
I'm trying to automate getting WiFi name & password.
My biggest issue is parsing the output in system.array format. Since I can't simply access the value by its key. I'm loking for a way to make ...
2
votes
1
answer
501
views
System.Array.IndexOf allocates memory
I've been profiling my code and found that System.Array.IndexOf is allocating a fair bit of memory. I've been trying to find out how come this happens.
public struct LRItem
{
public ProductionRule ...
3
votes
3
answers
1k
views
C# loop over an array of unknown dimensions
I want to create an extension method to loop over System.Array with unknown number of dimensions
For now I am using a naive approach:
public static void ForEach<T>(this Array source, Action<...
-3
votes
1
answer
978
views
System.Array.IndexOf returns -1
I put a screenshot that will tell you everything.
private Transform[] hiddenObjects;
void Start()
{
leftImageRandom = new Randomizer(0, LeftImageSequence.transform.childCount - 1, true);
...
2
votes
3
answers
118
views
I don't understand a code to load picture in java
I am working with OpenCV in java, but I don't understand part of a class that loads pictures in java:
public class ImageProcessor {
public BufferedImage toBufferedImage(Mat matrix){
int type = ...
2
votes
2
answers
926
views
Marshalling System.Array from .Net to vb6
I have a .Net component that has a COM visible class with a method that returns a System.Array. Under the hood it returns a string array, however the return type is declared as System.Array. Don't ask ...
11
votes
7
answers
7k
views
Why System.Array class implements IList but does not provide Add()
This code:
int[] myArr = { 1, 2 };
myArr.Add(3);
throws the following error on Build:
error CS1061: 'System.Array' does not contain a definition for 'Add' and no extension method 'Add' accepting a ...
3
votes
3
answers
4k
views
How do you test for null elements in System.Array
I'm parsing an excel document into a System.Array and then using this data to develop a DataTable. The problem is that not every element in the System.Array contains a string and is null. See image ...
0
votes
0
answers
181
views
Resize System.Array using Array.Resize
Hello there StackOverflowers.
I was wondering if it's possible to resize a System.Array using the shared method Array.Resize.
I can't seem to get it to work; it only works if I, for instance, write:...
2
votes
1
answer
397
views
How to efficiently write System.Array to a binary file in IronPython?
I have to write a System.Array (1e09 items from type Single) to a binary file. I could of course loop over the Array with .GetValue() and pack each Single in a 4-Byte struct, but this is very slow.
...
8
votes
1
answer
345
views
Fastest way to apply arithmetic operations to System.Array in IronPython
I would like to add (arithmetics) two large System.Arrays element-wise in IronPython and store the result in the first array like this:
for i in range(0:ArrA.Count) :
arrA.SetValue(i, arrA....
1
vote
1
answer
218
views
How to preserve null in system.array - C#?
I got the first row of an excel sheet with the following code.
Excel.Range firstRow = ws.UsedRange.Rows[1];
var row = (System.Array) firstRow.Cells.Value;
List<object> Array = row.OfType<...
3
votes
1
answer
3k
views
Why am I getting "'System.Array' does not contain a definition for 'AsBuffer'" with this WinRT code?
According to this, the following code can be used to convert a byte array into a BitmapImage:
public static async Task<BitmapImage> ByteArrayToBitmapImage(this byte[] byteArray)
{
if (...
0
votes
1
answer
161
views
Defining a function with argument of type System.Array in ASMX C# web service
I am getting the following error
You must implement a default accessor on System.Array because it inherits from ICollection
Following is my source code,
public string extractOutput(ref System....