« first day (2101 days earlier)      last day (1255 days later) » 

11:08 AM
I am new to C#. In one of projects, I came across this code to compress and decompress a text:
//Compressing:
using System.IO;
using System;
using System.IO.Compression;
using System.Text;

public class Program
{
public static void Main(string[] args)
{

string plainText = "shantha";
byte[] buffer = Encoding.UTF8.GetBytes(plainText);
var memoryStream = new MemoryStream();

using (var gZipStream = new GZipStream(memoryStream, CompressionMode.Compress, true))
{
gZipStream.Write(buffer, 0, buffer.Length);
#decompressing

using System.IO;
using System;
using System.IO.Compression;
using System.Text;

public class Program
{
public static void Main(string[] args)
{

string compressedText = "BwAAAB+LCAAAAAAABAArzkjMK8lIBADfNokfBwAAAA==";

//Console.WriteLine(Encoding.UTF8.GetString(compressedText));

byte[] gZipBuffer = Convert.FromBase64String(compressedText);
using (var memoryStream = new MemoryStream())
{
int dataLength = BitConverter.ToInt32(gZipBuffer, 0);
memoryStream.Write(gZipBuffer, 4, gZipBuffer.Length - 4);
 
2 messages moved from Python
 
 
10 hours later…
9:41 PM
Anyone happen to know what the return type of this Julia code would be? Trying to translate to Python:
`function SymPyFun(fun::Array{SymPy.Sym,1},
xval::Float64,yval::Float64)
#
# Given an array of SymPy expressions,
# evaluates the expressions at (xval, yval).
#
result1 = Float64(subs(subs(fun[1], x, xval), y, yval))
result2 = Float64(subs(subs(fun[2], x, xval), y, yval))
return [result1; result2]
end`
 
@KeithMadison ask julia people? Or run the code?
it's whatever object square brackets create
@KeithMadison this has zero things to do with Python
5 messages moved from Python
 

« first day (2101 days earlier)      last day (1255 days later) »