console-application

How can I know that the user hit the ESC key in a console with ncurses (Linux)?

爱⌒轻易说出口 提交于 2019-12-11 03:09:43
问题 I have a problem in detecting whether I just got a plain ESC key (just code 27) or whether it was another special key such as an Arrow Up which sends me three bytes: ESC [ A (27 91 65). Now, I understand escape sequences, what I don't understand is how can I possibly know that the user actually typed ESC instead of a special key since both start with 27 and ESC is only 27? Note that I use the wgetch() function from ncurses as in: // initialization not shown initscr() should be enough for this

The 'OraOLEDB.Oracle' provider is not registered on the local machine, when working with a console application?

断了今生、忘了曾经 提交于 2019-12-11 03:07:29
问题 I have this website application I've been working on, VB.NET .NET 3.5, everything works fine. I also need to develop a console application that updates the website's database. I use an Oracle 10g database. I copied the same connection class I use on my main project, when I try to call the connection method I get this error: The ConnectionString property has not been initialized. Or this error if I don't use the class and call the code directly: The 'OraOLEDB.Oracle' provider is not registered

sort numbers which has odd-index in vector

会有一股神秘感。 提交于 2019-12-11 02:34:55
问题 I want to sort numbers in vector which has odd-index (index starts from 0 ). For example, if I enter this numbers; 1 6 5 7 3 2 0 , program must returns this: 1 2 5 6 3 7 0 . My code #include <iostream> #include <vector> using namespace std; int main() { int eded, n, _temp; size_t i; cout << "Nece eded daxil edeceksiniz?" << endl << ">>> "; cin >> n; vector<int> v_eded; v_eded.reserve(n); // n qeder bosh yer ayiriram vektor-da cout << "Ededleri daxil edin:" << endl; for (int i = 0; i < n; i++)

Multiplying BigInteger by Double

风流意气都作罢 提交于 2019-12-11 01:40:39
问题 My Physics teacher gave the class a hard task. I'm trying to create a program that will calculate some things for me. At a certain point I need to multiply an amount of molecules by a percentage. Ulong can't hold numbers as large as 6022 * 10 ^ 19, so I have to use BigInteger from .net 4.0. However multiplication cannot be applied to BigInteger and double. I only need the whole number. Is there any way to bypass this? The code is as follows: private static BigInteger pencapmoles = BigInteger

Using HTTP routes within ZF2 console application

China☆狼群 提交于 2019-12-11 01:36:03
问题 I'm trying to write a console action to regenerate the XML sitemap for my application. ZF2 is detecting that I'm running the CLI version of PHP and is thus using console routing, but it then chokes with a "Route with name 'xxx' not found" when Zend Navigation tries to build the sitemap, because it doesn't know about any of the named HTTP routes. The same code works perfectly fine when used through the normal HTTP controller. Is there a way to make HTTP routes work within a console application

VisualStudio 2017 Console Project template missing

雨燕双飞 提交于 2019-12-11 00:37:14
问题 Yes, i've tried devenv/install, with no help. So, I don't have the Console C# Project option when creating the project, as shown here Currently i have installed windows basic pack - there's my 'about' screen. I have just reinstalled Windows because i was getting the same exact problem on old system, and because VS2015 had interface bugs and crashed consequently, but it didn`t help(as well as reinstalling both VS 2015 and 2017 numerous times) Hope that you can guess whats wrong with my PC. 回答1

How to indicate that a urwid listbox has more items than displayed at the moment?

一曲冷凌霜 提交于 2019-12-11 00:36:44
问题 Is there a way to show a user that a urwid listbox has additional items above / below the dispalyed section? I'm thinking of something like a scrollbar that gives an idea of the number of entries. Or a separate bar at the top / bottom of the list box. If this behavior can not be implemented, what approaches are there to achieve this notification? During my research, I found this question, which tried to achieve eventually the same. The given answer seems to check if all elements are visible.

Redirect Console.WriteLine() output to string

ⅰ亾dé卋堺 提交于 2019-12-10 23:35:13
问题 I need to take Console.WriteLine() output, and append to a string. I cannot change the Main method to simply append to a string instead of writing to console - I need a method to read all written lines from the console and append them to a string. Currently, I have been using a FileStream and redirecting console output into a text file, and then reading from that. var fs = new FileStream("dataOut.txt", FileMode.Create); var sw = new StreamWriter(fs); Console.SetOut(sw); Console.SetError(sw);

How to read Cyrillic symbols from a .txt file with C#

女生的网名这么多〃 提交于 2019-12-10 22:57:01
问题 I saw similar topics but could not find a solution. My problem is that I have a .txt file in which the symbols are in Bulgarian language / which is Cyrillic /, but after trying to read them, there is no sucess. I tried to read with this code: StreamReader reader = new StreamReader(fileName,Encoding.UTF8); if (File.Exists(fileName)) { while ((line = reader.ReadLine()) != null) { Console.WriteLine(line); } } And I also changed the Encoding value to all possible , as I tried with GetEncoding

C# Console/Server access to web site

*爱你&永不变心* 提交于 2019-12-10 21:31:33
问题 I am working on a C# project where I need to get data from a secured web site that does not have an API or web services. My plan is to login, get to the page I need, and parse out the HTML to get to the data bits I need to log to a database. Right now I'm testing with a console app, but eventually this will be converted to an Azure Service bus application. In order to get to anything, you have to login at their login.cfm page, which means I need to load the username and password input