Here in the US, there is a small airline called Sun Country. It started life as a charter only company but went into regular service a few years ago. It has very limited routes, and they only go to some destinations part of the year. However, if you are lucky enough to live near an airport they do serve AND need to go to one of the other places they go, there is no comparison. Every flight is one way. Round trip is simply two flights. The pricing varies per day, and does change frequently, but it is almost always the best price. I keep hoping other airlines will adopt this method, but the chances are very small.
abupsman
Posts
-
Regarding airline booking- Round trips vs one way? -
Time Machine.After reading all the other posts, I just had put one of my own in here. A program was written waaaaay back in 1992, running on a DOS box. It was a set of compiled Quick BASIC .exe files. It was so well written, and the processes that it was conrolling and monitoring so stable that it has been sitting in the corner of the computer room since then. Well, finally some of the hardware that it interfaced with could no longer be repaired. This meant new equipment, and some changes to the program controlling it. I have to thank the original programmer, now many years gone. The code was almost 50% comments, and the variable names very descriptive. He also thoughtfully packaged up the program and compiler (MS Quick BASIC 4.0, from 1987!!!) While I did used to code quite a bit in QBasic, that was many, many years ago. It almost took me longer to "remember" how to navigate (no mouse support) the program and recall some of the tricky bits that it did to make the changes. After three weeks I was a pro again! I did fully comment the changes, I even documented the changes in a log file I found (last updated in Jan of 1994). I did bring the project into a bit of the modern age by making an offline copy of the entire set of data files and burning them to a set of CD's. (not that the hardware it runs on even thinks about CD's, it still has a pair of 40MB HD's and a 5.25" floppy drive) It probably will not be touched agin for years, but I feel good that the next software Archeologist that had to deal with it is in no worse position that I was. :)
-
Logging Shutdown event in Windows ServiceI would like to request some suggestions on a problem I am having with a Windows Service I built. It installs and runs fine, using a timer every minute to check for files, then running a process. I have the process logging to a Windows Event Log, also, every time if does find and process a file it writes a record to a remote SQL server with file stats. The third thing the service does is send out e-mails. One type is a daily summary with totals and stats The second is whenever an error is caught, it collects the error data and sends it to a support group (Also writes to the event log) I also e-mail, write SQL & log at service Start and Stop. The issue is that the logging works OK at Stop if I do it from the Services panel in Admin Tools. However, if the Box is re-started by doing a Start/Shutdown/Re-start, I get no logging or e-mails to notify that the box is going down. I do get the Start up messages and logging minutes later when the system restarts. However, if someone were to do a Start/Shutdown/Shutdown, I would not be notified and it might be several hours before other processes noticed that the data stream had stopped and complain about it. Here is the code from my OnStop section:
protected override void OnStop() { //Close all open connections closeResources("ALL",9); // Log shutdown event eventLogOSNUCAS.WriteEntry("OSNUCAS Reader is shutting down",EventLogEntryType.Error); //writeDashboardLogLine on SQL writeDashboardLogLine("OMAH799", "###########", 0, "OSNUCAS Reader is shutting down", 0, 0, 0, 0, "Stopped", "##########NUCASReader on " + Environment.MachineName + " has shut down"); // Notify support AutoEMailSender("########## NUCAS Reader is shutting down", "########### NUCAS Reader service is shutting down\n", 1); }
What do I have to do to ensure that a shutdown event is logged? (Obviously, I cannot log a power outage, but a UPS generated forced shutdown due to low battery would also NOT be recorded) Thanks, Don -
Issue using .dll in Program vs ServiceLuc, Thanks for sparking an idea that did fix prt of the problem. Your #5 comment did the trick (the "My Documents" bit!) It appears that while it is running as a console app, any file calls are, unless otherwise directed, sent to the folder where the .exe file is. In my case, to make this old .dll work, there MUST be a .cfg configuration file AND a file name reference .txt file in the same folder as the libhab2.dll. As an console app, those were placed there by the installer. I guess I assumed that this was the case with a Service also. NOT.....! All calls are sent to the C:\WINNT\System32 folder. I placed copies of the .cfg and .txt (the .dll was alredy there) in there and it works! Now I just have to figure how to redirect the "local" folder of a system login. (I guess I could leave the files in system32 but that feels wrong somehow!) Error trapping did not help because the .dll just returned with a Zero and no other information. It had been writing to it's own log file, but I did not see it because I was expecting to to be created and added to in the C:\Program Files\OSNUCASReader folder, not C:\WINNT\System32. If I had done a global search of my HD looking for "hafelog.log", I would have saved a week of hairpulling! The log only had a line like this: "20080116115428 23KDGWDLOG F_Dialog e 00085370Internal processing error encountered during routine operations. " BUT, it would have let me know that the .dll was being called. I just was not thinking about the System32 folder (too many trees to see the forest I guess) Anyway, thanks for the suggestions and the spark to get me moving forward. Don :-D
-
Issue using .dll in Program vs ServiceLuc Good suggestions all. I may have edited out too much when posting the code... Anyway, I have run this with lines just before and after the HABRSCI call logging to an eventlog so I know it is getting to this line. As to exceptions, they never come into play, no errors are happening (I have logging events in those sections also, never happen) I can watch the app run by monitoring the lines being added to the event log, it loops every three minutes (current setting) and does several things, but the .dll never responds. I did test it by adding code to return an int, but that always stays at zero in the Service (= no result) but returns either 4,8, or 16 in the Console version (indicates type of response collected by .dll) If the .dll works, it generates a small text file with result data AND adds a 65 char line record to a text file in the local folder with status and timestamp information. This happens in the console version but not in the service version. I will try the explicit call in #5 above to see if that helps. Thanks, Don :)
-
Issue using .dll in Program vs ServiceI need some assistance in tracking down why my code will not run as a service. I have been hacking at this for over two weeks on and off with no real progress. I need to use an old dll to access data. When I call it from a console app, it works just fine. Here is a snip of the code that works... [DllImport("C:\\Program Files\\Omaha_Steaks_NUCAS_Reader\\libhab2.dll")] public static extern int HABRSCI(string RSCI1, string RSCI2, string RSCI3, string RSCI4, string RSCI5); static void Main() { try { //Create Variables for Host Access string string resbuff = new string(' ', 80); string reascode = "0000"; HABRSCI("0000", "01", "nucas.txt\0", resbuff, reascode); } catch (Exception ex) { string zzzz = ex.Message; } } I rewrote as a Service, everything works except the dll call, it just acts as it was never called at all. Here are some snips from my Service code.... //Set up usage of the .dll for Host Access [DllImport("C:\\Program Files\\OS_NUCAS_Reader\\libhab2.dll",EntryPoint = "HABRSCI")] public static extern int HABRSCI(string RSCI1, string RSCI2, string RSCI3, string RSCI4, string RSCI5); and later, inside of a timer event.. try { //Create Variables for Host Access string string resbuff = new string(' ', 80); string reascode = "0000"; HABRSCI("0000", "01", "nucas.txt\0", resbuff, reascode); } catch (Exception ex) { } This is just ignored!!! I know the code executes around it, I have even added lines to write to the Event log just before and after the call. If it works, a text file is created and a records is added to a log file maintained by the dll. none of these are happening so it apears that it ignores the call to the dll when running as Service. Any assistance would be much appreciated. Thanks, Don