Category Archives: StackOverFlow

Stack Overflow is a question and answer site for professional and enthusiast programmers.

Usage of Created Formats from SAS Data Sets

I have created a formats like following

data formatset;
    input fmtname $ start $ end $ label $;
    datalines;
$test region1 region3 zone1
$test region4 region5 zone2
$test region6 region7 zone3
;
run;

proc format library = work.formats
    cntlin = work.formatset;
run;
quit;

Problem: I will have new datalines data with the variable region. And i want to have a new attribute zone which use the format $test.

read more

"Value of ‘null’ is not valid for stream"

Attempting to download an image from a URL into memory. Getting an error on the response stream.

Exception calling “FromStream” with “1” argument(s): “Value of ‘null’ is not valid for ‘stream’.”

Function Download-Image {
$req = [System.Net.WebRequest]::Create
("http://www.wired.com/images_blogs/business/2012/12/google.jpg")
    $response = $req.GetResponse()
    $ResponseStream = $Response.GetResponseStream()
    [System.IO.Stream]$stream = $ResponseStream
    #$response.close()
}

[byte[]]$image = Download-Image

Add-Type -AssemblyName System.Windows.Forms

$img = [System.Drawing.Image]::FromStream([System.IO.MemoryStream]$image)
[System.Windows.Forms.Application]::EnableVisualStyles()
$pictureBox = new-object Windows.Forms.PictureBox
$pictureBox.Width =  $img.Width
$pictureBox.Height =  $img.Height
$pictureBox.Image = $img

$form = new-object Windows.Forms.Form
$form.Width = $img.Width
$form.Height =  $img.Height
$form.AutoSize = $True
$form.AutoSizeMode = "GrowAndShrink"
$form.Icon = $icon
$form.controls.add($pictureBox)
$form.Add_Shown( { $form.Activate() } )
$form.ShowDialog()

read more

Bitnami WordPress site re-setup

so I have successfully installed Bitnami on my Linux. Purchased a theme from themeforest created a couple of pages using visual composer and some other plugins, customized some theme options, created a child theme and added some custom css in it. All well and dandy.

Now I’m trying to transfer the whole thing on other computer with some demands if possible. For better understanding of what I’m after lets simplify some things. Lets call:

The original(no changes have been made) purchased theme zip …… T1

read more

Access denied exception when running a .Net 4.5 application published using VS

I had a test build I was supposed to publish to the testing team. I used the default “Publish ” option in visual studio to create an installer. It created the installer successfully, and application is getting installed.

But when running the application, it throws an error saying “Access Denied exception occurred” in “System.Deployment” class. I have no idea what is happening here, because my code is not even coming to picture here. It is just the default deployment tool’s classes that are failing activation.

read more