topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday November 11, 2025, 11:08 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 97 98 99 100 101 [102] 103 104 105 106 107 ... 122next
2526
Living Room / Re: Anyone want to write an eBook in 2011?
« Last post by kyrathaba on January 02, 2011, 04:52 PM »
@40hz - good points, all.

I was hoping this thread would spark some ideas.  At this point, I don't have any firm ideas myself.  I was more hoping to sign on with someone else who might be sparked by this thread.  If not, I will pitch my efforts into a solo novel.

2527
N.A.N.Y. 2011 / Re: NANY 2011 :: The Event Closes
« Last post by kyrathaba on January 02, 2011, 04:48 PM »
Many thanks to Perry, Mouser, and all the participants!  :up:
2528
N.A.N.Y. 2011 / Re: NANY 2011 Pledge: "VeggieSquares" - Children's Game
« Last post by kyrathaba on January 02, 2011, 04:38 PM »
I am using a language that only one other DC'er uses that I am aware of

What programming language are you using?
2529
Living Room / Re: Anyone want to write an eBook in 2011?
« Last post by kyrathaba on January 02, 2011, 04:28 PM »
So is there not much interest in this?  I was hoping to coauthor something, with someone.
2530
Living Room / Re: What books are you reading?
« Last post by kyrathaba on January 02, 2011, 09:47 AM »
About to finish "By the Light of the Moon", which will be my 19th Dean Koontz novel.  After that, I switch from paperback to my Kindle, where I was able to obtain a $4.99 eCopy of O'Reilly's "C# 3.0 Design Patterns", by Judith Bishop.
2531
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 07:10 PM »
I've updated my Snipplr posting here.
2532
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 04:48 PM »
I'll be scratching my head over this one for a while, but it all works as expected now; no inexplicable hanging (even when doing the upload on its own asynch thread, it had 'seemed' to be hanging, in that I got a non-responsive UI):

2533
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 04:26 PM »
Interesting.  The second MessageBox never gets invoked.  At least, I never see it pop up when I run the program click my button to upload the file:

Code: C# [Select]
  1. public void UploadFile(string FullPathFilename) {
  2.             string filename = Path.GetFileName(FullPathFilename);
  3.  
  4.             try {
  5.  
  6.                 FtpWebRequest request = (FtpWebRequest)WebRequest.Create(_remoteHost + filename);
  7.                 request.Method = WebRequestMethods.Ftp.UploadFile;
  8.                 request.Credentials = new NetworkCredential(_remoteUser, _remotePass);
  9.  
  10.                 StreamReader sourceStream = new StreamReader(FullPathFilename);
  11.                 byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
  12.  
  13.                 request.ContentLength = fileContents.Length;
  14.  
  15.                 Stream requestStream = request.GetRequestStream();
  16.                 requestStream.Write(fileContents, 0, fileContents.Length);
  17.  
  18.                 MessageBox.Show("About to make upload request..."); //this one "pops-up", as expected
  19.                 FtpWebResponse response = (FtpWebResponse)request.GetResponse(); //does get invoked (my file DOES get uploaded)
  20.                 MessageBox.Show("Made upload request.  About to close streams..."); //I never see this one
  21.  
  22.                 response.Close();
  23.                 requestStream.Close();
  24.                 sourceStream.Close();
  25.  
  26.             }
  27.             catch (Exception ex) {                
  28.                 MessageBox.Show(ex.Message, "Upload error");
  29.             }
  30.             finally {
  31.  
  32.             }
  33.  
  34.         }
2534
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 03:09 PM »
Okay, my button Click event now hands the file upload off to a backgroundWorker object running on its own thread:

Code: C# [Select]
  1. private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) {
  2.             MessageBox.Show("Doing some work...");
  3.             string username = "my_username";
  4.             string password = "my_password";
  5.             string host = "ftp://glensforkumc.com";
  6.             string myLocal = Path.GetDirectoryName(Application.ExecutablePath) + "\\myTextFile.txt";
  7.             string myRemote = host + "/httpdocs/non_church/";
  8.             clsFTPclient client = new clsFTPclient(host + "/httpdocs/non_church/", username, password);
  9.             client.UploadFile(Path.GetDirectoryName(Application.ExecutablePath) + "\\myTextFile.txt");
  10.  
  11.         }
  12.  
  13.         private void backgroundWorker1_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) {
  14.  
  15.             MessageBox.Show("I'm done uploading");
  16.         }

The file does get uploaded, but my RunWorkerCompleted() messageBox never pops up... remove everything except the messageBox from the _DoWork() method above, and it's msgBox (as well as RunWorkerCompleted's msgBox) both fire as expected.
2535
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 02:49 PM »
Good points, all.  I was just doing a quick and dirty test of the UploadFile method is all.  In a full-blown application, I'd have the btnWhatever_Click handler hand off the task to a backgroundWorker object.

Maybe I'll create one and see if that fixes this issue.  Although, in the current case, why does DownloadFile work without hanging the UI, but UploadFile hangs it?  Hmm...
2536
Developer's Corner / Re: Check Gmail using C#
« Last post by kyrathaba on January 01, 2011, 02:21 PM »
I have the following functioning code to upload programmatically via FTP in C#:

Code: C# [Select]
  1. public void UploadFile(string FullPathFilename) {
  2.             string filename = Path.GetFileName(FullPathFilename);
  3.  
  4.             try {
  5.  
  6.                 FtpWebRequest request = (FtpWebRequest)WebRequest.Create(_remoteHost + filename);
  7.                 request.Method = WebRequestMethods.Ftp.UploadFile;
  8.                 request.Credentials = new NetworkCredential(_remoteUser, _remotePass);
  9.  
  10.                 StreamReader sourceStream = new StreamReader(FullPathFilename);
  11.                 byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
  12.  
  13.                 request.ContentLength = fileContents.Length;
  14.  
  15.                 Stream requestStream = request.GetRequestStream();
  16.                 requestStream.Write(fileContents, 0, fileContents.Length);
  17.  
  18.                 FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  19.  
  20.                 response.Close();
  21.                 requestStream.Close();
  22.                 sourceStream.Close();
  23.  
  24.             }
  25.             catch (Exception ex) {                
  26.                 MessageBox.Show(ex.Message, "Upload error");
  27.             }
  28.             finally {
  29.  
  30.             }

Now for the problem.  When I use this method in the following button click event, it does upload the file to the desired directory of my website, but then my UI hangs.  I have to kill the program from within the IDE.

Code: C# [Select]
  1. private void btnUploadTxtFile_Click(object sender, EventArgs e) {
  2.  
  3.             string username = "my_username";
  4.             string password = "my_password";
  5.             string host = "ftp://glensforkumc.com";
  6.  
  7.             try {
  8.                 clsFTPclient client = new clsFTPclient(host + "/httpdocs/non_church/", username, password);
  9.                 client.UploadFile(Path.GetDirectoryName(Application.ExecutablePath) + "\\myTextFile.txt");
  10.             }
  11.             catch (Exception ex) {
  12.                 MessageBox.Show(ex.Message, "Upload problem");
  13.             }
  14.         }

Doesn't hang when using a similar method to download a file.  Any idea why my UI is freezing up after a successful upload?
2537
N.A.N.Y. 2011 / Re: NANY 2011 Pledge: "VeggieWorld" - Children's Game
« Last post by kyrathaba on December 31, 2010, 07:06 PM »
now I have to hard code all the responses.  To give you an idea what I am up against...

    * I only chose 16 "most common" "Veggies"
    * For every Veggie the child(?) places on the screen, I have to run a collision routine on all the other sprites and test for compatibility/incompatibility and then display an apropos response.
    * If the child(?) clicks on any other Veggie, I have to repeat the step above, but with a mod for not presenting the same response to keep from being tedious.
    * Keep in mind THIS only applies to one of each Veggie.  I haven't even broached the necessity for multiple "tomatoes!"

Hey, Calvin,

What language are you programming in?  Have you built a method (a.k.a. function/subroutine) that takes a Veggie as a parameter, and then decides if there are any sprite collisions?  I was also going to suggest using a Random object to randomize the responses.
2538
Just checked mine.  All benign.
2539
N.A.N.Y. 2011 / Re: NANY 2011 Release: NANY Excuse Manager (v0.96 as of 12/30/10)
« Last post by kyrathaba on December 31, 2010, 06:10 PM »
ALL, best wishes for a wonderful New Year!  My family and I will be departing shortly for a New Year's Eve church service.

I've updated the OP considerably today.  The final N.A.N.Y. 2011 release version is v0.96q.  Yeah, I did a lot of revision work on v0.96, probably as much as v0.9 through v0.95 all combined.

Congratulations to all the folks who are submitting New Apps for the New Year!  I'm looking forward to seeing everyone's submission, and the reviews!  Thanks to Perry for all the time and energy he's spent coordinating things.
2540
Just kiddin' -- gotta get a little ribbing in before the New Year  :D
2541
You do mean "stiffed", right Mouser?  :P
2542
Living Room / Re: Anyone want to write an eBook in 2011?
« Last post by kyrathaba on December 31, 2010, 04:51 PM »
Hmm, what I'm thinking is that it would be really cool to have something similar/parallel to N.A.N.Y., except book-authoring related.  Maybe one of the following...

B.R.A.N.Y. -- Books Ready to Apprehend in the New Year
apprehend = absorb, appreciate

D.A.N.Y. -- Digital works of Art for the New Year
"art" = novels, haiku, books of your paintings, drawings, etc.

Individual or groups of individual DC members could work on these throughout 2011, giving whatever teasers they wish to keep our interest whetted, and then could spring these on us on Jan 1st, 2012.  If a work is intended for sale on Amazon.com, you'd make the purchase-and-download link available at that time.  Free works could continue to be hosted here, or on users' private websites.


2543
Living Room / Re: Anyone want to write an eBook in 2011?
« Last post by kyrathaba on December 31, 2010, 04:16 PM »
Here's a short, concise YouTube video showing how easy it is to publish your eBook, so that it can be bought and downloaded by Amazon.com customers.
2544
Living Room / Anyone want to write an eBook in 2011?
« Last post by kyrathaba on December 31, 2010, 03:59 PM »
amazon_dtp.png

In July 2010 that number goes to 70% for authors, provided ebooks are between $2.99 and $9.99 and not for sale elsewhere for less and that they're priced lower than a printed copy. Pressure from other retailers forced Amazon to make concessions. There's never been a better time to be an Indie author.

Read more: How to Sell a Book in Kindle Format | eHow.com http://www.ehow.com/...t.html#ixzz19jEd40Mf

Dear Publishers,

We are excited to announce Kindle book lending (http://www.amazon.com/kindle-lending). Kindle book lending allows readers to lend your books to their friends/family. We have automatically enrolled your Kindle books in the Kindle Book Lending program. For more information about the program, and whether you can change your book lending participation, visit our FAQ here: http://forums.digita....jspa?externalID=581.

Sincerely,

DTP David

Anyone planning on taking advantage of this in 2011?  That would be a really awesome group project!  There are some highly intelligent, awesomely talented individuals who frequent this site.  I imagine some very high-quality works could be produced, either individually or as a group effort.

Here's a cool idea: coders developing their own instruction book teaching programming concepts.  I've noticed there are some really great teachers here on DC.
2545
N.A.N.Y. 2011 / Re: NANY 2011 Release: JottiQ
« Last post by kyrathaba on December 31, 2010, 03:31 PM »
Next year we must get a countdown ticker... 

Definitely!!

I tried to synch-up my laptop clock, but I find a 2-3 second discrepancy between the www.datetime.com website, and time.windows.com ...


dateTime.png
2546
Living Room / Re: So, when you're working, do you...
« Last post by kyrathaba on December 31, 2010, 02:03 PM »
I work best at my desk.  No music with words, although classical or anything low-volume without lyrics isn't distracting to me:

SANY0336.jpg
2547
Living Room / Re: Happy New Year & NANY Deadline Day!
« Last post by kyrathaba on December 31, 2010, 01:58 PM »
Happy New Year to all and sundry!  :D
2548
N.A.N.Y. 2011 / Re: NANY 2011 Release: NANY Excuse Manager (v0.96 as of 12/30/10)
« Last post by kyrathaba on December 31, 2010, 11:17 AM »
Go do it the fancy way and use layered windows instead. UpdateLayeredWindow is the epic function you want. It's a pain to use, but you can get really pretty results with it. smiley

@worstje:  I wound up rolling-my-own (uncomment the line assigning an image to splash.BackgroundImage; of course, you have to embed an image resource in your application, first):

Code: C# [Select]
  1. public Form1() {
  2.             InitializeComponent();
  3.             this.StartPosition = FormStartPosition.CenterScreen;
  4.         }
  5.        
  6.  
  7.         private void Form1_Load(object sender, EventArgs e) {
  8.            
  9.             Form splash = new Form();
  10.             splash.Size = this.Size;
  11.             splash.StartPosition = this.StartPosition; //same as Form1
  12.             splash.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  13.             //splash.BackgroundImage = ExcuseManager.Properties.Resources.kyr_splash;
  14.  
  15.             this.Hide();    //hide our main form...
  16.             splash.Show();  //...and show splash screen
  17.  
  18.             System.Threading.Thread.Sleep(3000);
  19.             splash.Dispose(); //leaving Form1 visible
  20.          
  21.         }
2549
N.A.N.Y. 2011 / Re: NANY 2011 Release: NANY Excuse Manager (v0.96 as of 12/30/10)
« Last post by kyrathaba on December 31, 2010, 11:06 AM »
It doesn't really scrutinize files at the binary level (although that wouldn't be difficult to code).

Regarding my previous post, note the part I made bold and a hyperlink (the part I quote above).  It got to bothering me that my code just checked file extension, rather than checking a file at the binary level to see if it was of the same type as a custom-defined class.

So, I've updated my C# Errata to include a solution.  The entire posting is here.
2550
N.A.N.Y. 2011 / Re: NANY 2011 last minute Pledge: Ethervane Radio
« Last post by kyrathaba on December 30, 2010, 10:32 PM »
Cool stuff, tranglos.  Good luck on the deadline  :Thmbsup:
Pages: prev1 ... 97 98 99 100 101 [102] 103 104 105 106 107 ... 122next