« first day (1417 days earlier)      last day (3526 days later) » 

2:03 PM
has anyone here used the nuget rest api before
 
Morning everyone!
 
Morning Jess.
 
@Greg funny how you call everyone by their real name
 
Greg knows all haha
What is everyone working on?
 
debugging, as usual
 
2:10 PM
Debugging what lol
 
@JLott Greg doesn't know my name ;D
 
@JLott everything, as usual
 
0
Q: How do I get next item in array with each button click?

SkullomaniaI have a table in SQL with over 200 different fruit types in it. What I am doing is creating an application that surveys a user about these different fruit types, using the same group of questions. The application will first ask the user to choose from different fruit types. I store the values wh...

I thought I asked this in a very clear way...seems its too vauge
 
@KendallFrey Geeze lol. I am creating a maintenance tool for our software for support... It is a pain.
 
Also why do people edit words like "The" from comments
rep farming?
 
2:13 PM
I think it is a pretty clear question lol and definitely
 
you can't get rep from comments
 
@KendallFrey he edited my question
 
useful tip of the day: you can put breakpoints in lambdas
also, conditional breakpoints are epic
 
@JLott he could have said he didn't know how to answer it or better yet not comment...i guess not knowing is a bad thing these days
lol
/endrant
 
@KendallFrey epic, and slow.
 
2:15 PM
slow is better than nothing
 
@JLott did you go to the renaissance festival this weekend? It was my first time...it rocked!
 
@KendallFrey Really?
I will rememmer that.
 
@Skullomania What renaissance festival?? Sounds awesome.
 
@JLott It was in Harveysburg Ohio. Here is the site renfestival.com
I didn't know what it was about and didn't care to go at first but the wife insisted it was fun so we loaded the kids up and went down....it kicked ass! Everyone there was in charecter people who went were in costume, seemed like everyone was wearing a costume except for me
its all good...ill have one next time
 
We actually had our housewarming this past weekend :) Found out we have Mennonites for neighbors and they offered to help us till our garden which is super awesome.
 
2:26 PM
@KendallFrey @JLott I use peoples real name as it is more polite and personable.
@JLott That is very, very cool.
 
I use people's handles, as it is the internet
 
@JLott You officially married yet?
 
@Greg be more subtle with your flirting
2
 
@KendallFrey Fuck your handle, Kendall.
@KendallFrey I'm married, why would I be flirting? Wtf?
 
nehehehe
 
2:28 PM
@Greg That was hostile O_o
 
@Sippy I can be combative.
 
@Greg Not yet haha
 
Do attributes only support primitive data types ?
 
@JLott that is super awesome...nothing better than peaches from amish town
 
They need to be created with compile-time constants
so whatever the compiler supports
 
2:33 PM
lol...someone post a comment on my question,"your code will not even compile" meanwhile im compiling the code...hahaha
 
@Skullomania Definitely.. We are lucky to have a large Amish community about 15 miles from us.
 
@JLott Kick ass! we are about an hour to the closest one Id say
 
so that doesn't include new data types
 
@JLott That is awesome, you both are still in the same town or did you move?
 
We moved about an hour from where we were
 
2:37 PM
@JLott Very cool.
 
I move about 10 seconds out of every day
 
If I'm defining a byte [] but I don't know the exact size as it is ever changing. How can I do an auto sizing byte []
 
List<byte>
 
@Greg Uh.. a List<byte>
 
or more likely, you are assigning it over and over and not changing its size, appending, removing, etc
in that case, just
byte[] foo = null;

foo = GetSomeData();
foo = GetSomeOtherData();
 
2:42 PM
I'm writing an FTP item, so I don't know the size of the file until it is read so:

            string localFile = @"";
            string[] allocate = server.Split('\\');
            string ftp = @"ftp://192.16.1.2/%2FImage/%2F" + allocate.Last();
            Uri uri = new Uri(ftp);

            if (uri.Scheme != Uri.UriSchemeFtp)
                return false;

            FtpWebRequest request = WebRequest.Create(uri) as FtpWebRequest;
            request.Method = WebRequestMethods.Ftp.DownloadFile;
So I'm trying to formulate the best approach to grab the remote file to write to the client.
 
Isn't there a Content-Length or similar?
 
@KendallFrey Well, the max is 4GB. But I doubt images will get near that.
 
guys I have stored some items in an array from a sql select and figured how to count each button click. What I want to do is select and display one item at a time in my array everytime I hit the button. Here I put the items in an array:

using (SqlDataReader reader2 = cmd1.ExecuteReader())
{
while (reader2.Read())
{
DepartmentList dl = new DepartmentList();
dl.DeptID = reader2.GetInt32(0);
dl.DepartmentName = reader2.GetString(1);
DepartmentList.Add(dl);
}
}
foreach (var departments in DepartmentList)
 
@KendallFrey That will work, I'll have to break my Stream apart, to have response and response stream.
 
2:50 PM
what?
Just... get the response like normal
 
Here is the original question I asked in the community, although i thought I explained it well enough noone seems to understand what I am talking about
http://stackoverflow.com/questions/25625272/how-do-i-get-next-item-in-array-with-each-button-click
 
typically you use a much smaller buffer than the size of the file
@Greg what are you doing with what you read? saving it to disk?
cause then you can just do stream.CopyTo(otherStream)
also - a stream reader is a text reader. you probably dont want that for images
 
@drch Well, I'm trying to read from remote and write to local.
@drch Ah, that is true.
 
@Skullomania so after you query the fruit types from your database, you store them in an array in memory?
 
@drch What should I use then to read the images?
 
2:59 PM
@EvanL yes. I store them in an array. Then I want to pull them out one by one each time I hit the button (ie. 1stbutton click "apple" 2nd button click "orange")
 
so...
 int currentIndex;

	protected void Button1_Click(object sender, EventArgs e)
	{
		textBoxOrWhatever.Text = arrayOfFruit [currentIndex];
		currentIndex++;
	}
@Skullomania That will display the next item in the array each time you click...
Obviously you will want to check for index out of bounds, null, etc...
Your question is unclear, because you only show the SQL calls, you show nothing about a button click, or the method in which you want to display the fruit.
Wow... that was waaay too many commas...
 
I played video games
 
@ton.yeung I didn't hear from Fed Ex, we need to call again.
 
I fought with my wife lol
good times ;)
 
@ton.yeung whats up man...i ended up working....but went to the renaissance festival on sunday
 
3:05 PM
@ton.yeung something like that lol. Going to talk to support today when they get in.
 
@ton.yeung Portal 2, Dwarf Fortress mostly
you do
 
lol dwarf fortress
such a time sink
 
I got em both 75% off a couple weeks ago
@EvanL almost as bad as minecraft
 
The developer for DF is crazy...
 
@drch @ton.yeung @RoelvanUden So, does this look correct then? And localFile needs to just show up in the browser.
        private bool DownloadPod(string server)
        {
            string localFile = @"";
            string[] allocate = server.Split('\\');
            string ftp = @"ftp://192.16.1.2/%2FImage/%2F" + allocate.Last();
            Uri uri = new Uri(ftp);

            if (uri.Scheme != Uri.UriSchemeFtp)
                return false;

            FtpWebRequest request = WebRequest.Create(uri) as FtpWebRequest;
            request.Method = WebRequestMethods.Ftp.DownloadFile;
            request.Credentials = new NetworkCredential(@"dev", @"dev");
 
3:11 PM
@Greg If you're just copying to a file, don't buffer, use CopyTo
 
?
 
Stream.CopyTo(Stream)
 
how do I type the nsfw tag in here?
 
[tag:tag-anything]
 
@ton.yeung (regarding renaissance) its good fun man!
 
3:15 PM
@KendallFrey Um, you sure?
 
@Thanks Kendell
 
@Greg What is there not to be sure about?
 
So ditch the FileStream.
 
yay I didest it
 
@Greg no, of course not
 
3:17 PM
last night was pretty awesome-weird in here lol. I kinda felt like I was in another room (not that there's anything wrong with this room)
DAMMIT I forgot to put cheese on my egg sammich
 
@KendallFrey Guess I'm not following how to use it.
 
@Greg rather than reading from the stream, buffering, and writing, use CopyTo, which essentially does all that for you.
 
@KendallFrey So don't even use FileStream. Just use CopyTo.
 
Yeah, you have to use FileStream
You don't have to write to it though
 
Can you show me the code, I'm still not following.
If I have to use FileStream wouldn't I still have to write, which is the part I'm trying to wrap my head around.
 
3:23 PM
I THINK IT BROKE BAEL
 
@Greg CopyTo writes to the stream
 
@Sippy TOTALLY
 
1 message moved to Trash
 
inputStream.CopyTo(outputStream)
 
Yay, I was invited to join greg in the trash lol. I wonder what's in there
 
3:24 PM
@KendallFrey So instead of:

using(FileStream file = stream.CopyTo(file)) ?
 
that will read inputStream to the end, and write the contents to outputStream
@Greg No, CopyTo doesn't return anything
@baeltazor hot steamy orgy, no doubt
 
hot
 
Lol
 
@KendallFrey I'll have to find some examples, I'm not visualizing.
 
3:27 PM
So in my example, I should be doing:

                using(Stream stream = response.GetResponseStream())
                    using(FileStream file = new FileStream(localFile, FileMode.Create))
                    {
                        stream.CopyTo(file);
                    }
 
Um, lol, read what you just wrote
 
@KendallFrey Shit
@KendallFrey I just wrote source, to source.
 
lol
 
um, lol, read again
 
@KendallFrey Modified.
 
3:29 PM
@Greg maybe you need some sleep, eh?
 
@baeltazor More than likely, but I gotta get this shit done today.
 
damn
 
@KendallFrey Can you enlighten me then.
 
What do you have now?
 
        private bool DownloadPod(string server)
        {
            string localFile = @"";
            string[] allocate = server.Split('\\');
            string ftp = @"ftp://192.16.1.2/%2FImage/%2F" + allocate.Last();
            Uri uri = new Uri(ftp);

            if (uri.Scheme != Uri.UriSchemeFtp)
                return false;

            FtpWebRequest request = WebRequest.Create(uri) as FtpWebRequest;
            request.Method = WebRequestMethods.Ftp.DownloadFile;
            request.Credentials = new NetworkCredential(@"dev", @"dev");
@KendallFrey The localFile I'm hoping to make just when you click download on a link it shows up in browser basically.
 
3:42 PM
I thought you were going to use CopyTo
 
@KendallFrey I was going to:
But I ended up not getting it right
which what I had was above
 
You mean:
16 mins ago, by Greg
So in my example, I should be doing:

                using(Stream stream = response.GetResponseStream())
                    using(FileStream file = new FileStream(localFile, FileMode.Create))
                    {
                        stream.CopyTo(file);
                    }
what isn't working?
 
The next line, file.Write
 
Why are you writing extra stuff to the file?
 
I'm not, so I don't even need to do File.Write?
 
3:45 PM
I thought you just wanted to write what is downloaded
 
It just copies the data from one stream to another and automatically writes it?
 
yes, of course
 
@KendallFrey Will that automatically show up as a popup in the browser?
When it writes to the clients machien?
 
wat
CopyTo has nothing to do with browsers
 
So this is on a web-page; then click this file it calls the remote server grabs the image and then it downloads to the client machine.
@KendallFrey I know that.
 
3:47 PM
I don't understand the question then
 
Can I make local file just show up as a download rather then have to navigate to the path?
 
In the browser?
 
that's the browser handling that...
 
I thought this was a desktop app
 
@KendallFrey No, its a web app
 
3:51 PM
Is your C# code on the server?
 
Yeah.
 
you should just show the item as an href to file I would assume?
 
@NETscape I can't.
 
It's essentially a desktop app then
 
@NETscape It is a remote server that isn't hosted, also... It has to populate the path to the file from the database.
 
3:51 PM
You want to show one of your clients that you downloaded a file on the server?
 
It is another server on the domain.
@KendallFrey Yeah.
 
Why?
If the client never downloaded anything, why would you try to fool them into thinking they had?
 
Server One: Host our web-site
Server Two: Houses the image

When the client is on Server one, they click View Signature it goes to Server Two and grabs the image to download to the Client.
 
client -> s1 -> s2?
 
I also always get this error: {"Access to the path 'C:\\Users\\prog\\AppData\\Roaming' is denied."}
 
3:55 PM
How is that related to this?
 
@Greg How are you trying to access that path?
 
@baeltazor Through that Ftp Code above.
 
@Greg You'll need to access the path like this Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData + @"\" + filename); You can't just um... pass the whole path as a string
 
are you allowed to link them straight to the ftp server?
just pass the credentials in the ftp uri
 
that sounds bad
 
4:00 PM
its ftp
lol
you need to provide some kind of link or image to the client if you want the browser to handle it as a download I think... that's my main point
 
Why can't I center a %#$#ing string?! Argh! The centering issue keeps changing even though I haven't touched the code for a couple hours now.
 
@NETscape What do you mean?
@NETscape No, IT won't allow it.
 
@baeltazor is this winforms?
 
All I can do is pass the path.
 
@Netscape Yeah, it's Windows Forms. And it's giving me cancer!
 
4:04 PM
@baeltazor Why wouldn't I just use Path.Combine rather then concatenate?
 
5 hours ago, by baeltazor
i feel like i have less control in WPF not sure if that's the case or not but it feels that way
 
@Netscape lol
 
my input is the same as Denver's
 
@Greg Oh, so you're already using Environment.SpecialFolder? I didn't see that
 
this is a 5 second thing in WPF
oh, and you might calculate wrong based on what font is used too, just an fyi (in winforms)
 
4:05 PM
Well, that did fix the issue. But now it puts the file on the clients desktop and they have no clue it is there or that it downloaded.
 
@Greg, ok, so you still don't have permission to save to the app's roaming folder. Windows does that. It moves it to the desktop when the app (or the user themselves, I forget which one) doesn't have sufficient privileges to write to that dir
 
@baeltazor Well, I can write to both. It still doesn't indicate a file was downloaded though.
 
hmmm
i'm just gonna go up and read ur code
 
@Greg whats the process to download a file?
you have a list of file names or something, you have the client select, one, then you click a button to download?
 
So the page loads, it goes through the database finds if it does have a delivery signature for the order. If it does the button appears, they click it. It downloads to the browser.
 
4:11 PM
how to insert form data in table using query
 
Well, that is my goal.
Right now it just uses the database
 
how about, you provide a list of the valid files that can be downloaded from the ftp site or whatever... when someone selects what they want to download, you save the file on the web server, then provide them a link to download that file?
 
@NETscape Not the way the business model works, each signature is assigned to the order that the person signed when they took the delivery.
 
Web server: FTP, give me your file list or whatever
Web server: Here Client, these are the files you can choose from, pick one to download
Client: Give me "escape_artist.jpg"
Web server: **download escape_artist.jpg from FTP site, and save it to mywebpage.com/escape_artist.jpg**
Web server: Hey client, click here to download the file (link to the path mywebpage.com/escape_artist.jpg)
critique dat @KendallFrey
 
@Pinkey - INSERT INTO TableName (Field1, Field2, ...) VALUES (@Param1, @Param2, ...)
 
4:24 PM
connection string is required ?
 
@NETscape @baeltazor Is there a way to make this a valid virtual path?

string ftp = @"ftp://192.16.1.2/%2FImage/%2F" + allocate.Last();
Because if there is, then I could use HttpResponse, then TransmitFile(path).
 
@Greg You can use Server.MapPath I'll go get docs for you
 
@baeltazor Doesn't that only work for "local" server though?
 
You're right, sorry, I completely forgot that.
 
@baeltazor Was hoping I could potentially bypass with:

                    HttpResponse content = HttpContext.Current.Response;
                    content.ClearContent();
                    content.Clear();
                    content.ContentType = "application/image";
                    content.AddHeader("Content-Disposition", "attachment; filename=" + allocate.Last() + ";");
                    content.TransmitFile(ftp);
                    content.Flush();
                    content.End();
But, unless I can make the ftp valid virtual path it will never transmit.
That would download and show it in the browser, the other way which does work sadly doesn't show that the file downloaded.
 
@SpencerRuport No, that is pretty cool though.
 
It's hilarious.
 
@SpencerRuport I take it their code technique is horrible? The idea is cool though.
 
Incorrect syntax near 'Faculty_Name'. this error
 
What is the opposite of Highlight?
:/
lol
 
4:36 PM
The fizzbuzz issues can be a great read too. github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/…
 
Serially?
 
@Pinkey - If you're asking about a connection string I think you need to take a step back and walk through some SQL tutorials.
 
lol
 
Hm, anyone know of a good way to make a created file show up on the browser?
@ton.yeung Have you been following?
 
@Greg any file? or an html file?
 
4:44 PM
@ahmadalishafiee I only care about an image.
This works, but I feel dirty doing it:
            if(request != null)
            {
                FtpWebResponse response = request.GetResponse() as FtpWebResponse;
                using(Stream stream = response.GetResponseStream())
                    using (FileStream file = new FileStream(localFile, FileMode.Create))
                        stream.CopyTo(file);

                HttpResponse content = HttpContext.Current.Response;
                content.ClearContent();
                content.Clear();
                content.ContentType = "application/image";
 
@Greg I don't know any direct way. but isn't it possible to create an html page with <img> and open it via Process.Start()?
 
hello folks
 
@Greg If you're just proxying, why use the temp file at all? Can't you CopyTo the response stream directly? Why not expose the image publicly?
 
@KendallFrey ?
 
5:03 PM
Can I just push the stream into the Transmit?
 
5:26 PM
@KendallFrey Yeah, I saw that a couple of days ago.
 
Object reference not set to an instance of an object. this error is display
what i do ???
 
@KendallFrey Well, if I could switch it to a byte[] I could just use BinaryWrite.
 
    SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["amsConnectionString"].ToString());
write this code
then errror is display
yes
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["amsConnectionString"].ToString());
string cs =" INSERT INTO Faculty values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + DropDownList1.Text + "','" + TextBox4.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + DropDownList2.Text + "','" + TextBox5.Text + "')";
con.Open();
cmd.ExecuteNonQuery();
con.Close();
all code isthis type
no
this code is right or not ???
 
@Greg sure, you could, but no sense in reimplementing CopyTo
 
answer ???
plz @Kendall Frey
give me solution please
 
5:40 PM
I'm just going to ignore you
4
 
As you should
 
Fastest ignore ever
 
...someone get smurf slapped?
i see
 
Test
Finally
 
@KendallFrey But then I could bypass the temp file.
 
5:44 PM
Something is wrong with veto sign login on Android stack exchange app
Logs me in as a completely new user each time
 
@ton.yeung The Wikipedia contains no knowledge of such a thing
 
Verisign*
 
@Pinkey no that code is not right. Question answered.
lol sorry
 
@Greg You could bypass it either way
you don't need a buffer, either in a file or in memory
 
Ton yep
 
5:56 PM
what is right answer ?
 

« first day (1417 days earlier)      last day (3526 days later) »