console-application

Can I force a firefox page refresh from linux console

微笑、不失礼 提交于 2019-11-30 06:56:52
This is the Linux version of this question . Does anyone have a method for forcing a page refresh on firefox from the command-line? geekQ You can use xdotool for automation. Install on Ubuntu with sudo aptitude install xdotool Then you can search for windows and send keys or mouse events, see man xdotool for the full documentation. I use following script on Ubuntu 10.04 LTS during development: WID=`xdotool search --name "Mozilla Firefox" | head -1` xdotool windowactivate $WID xdotool key F5 See also the xdotool project site and my full blog post . The best solution I've found so far.. Install

Error message “CS5001 Program does not contain a static 'Main' method suitable for an entry point”

廉价感情. 提交于 2019-11-30 06:20:18
问题 Unable to execute the following code error CS5001 Program does not contain a static 'Main' method suitable for an entry point What does this error message mean? class Program { static async Task MainAsync(string[] args) { Account.accountTest accountTest = new Account.accountTest(); bool result = await accountTest.CreateAccountAsync(); } } 回答1: It means that you don't have a suitable entry point for your application at the moment. That code will nearly work with C# 7.1, but you do need to

apparent side effects of writeln (“:width” specifier causes question marks in output)

自作多情 提交于 2019-11-30 05:56:45
问题 I have the following code (RAD Studio XE2, Windows 7 x64): program letters; {$APPTYPE CONSOLE} {$DEFINE BOO} const ENGLISH_ALPHABET = 'abcdefghijklmnopqrstuvwxyz'; begin {$IFDEF BOO} writeln; {$ENDIF} write(ENGLISH_ALPHABET[1]:3); readln; end. When {$DEFINE BOO} directive is turned off , I have the following (expected) output (spaces are replaced with dots for readability) : ..a When the directive is turned on , I have the following (unexpected) output: // empty line here ?..a instead of

How to create ASCII animation in a console application using Python 3.x?

社会主义新天地 提交于 2019-11-30 05:44:24
I would like to port this question to Python (Windows + Linux + Mac Os) How to create ASCII animation in Windows Console application using C#? Thank you! Philip Daubmeier I just ported my example with the animated gif to ASCII animation from my answer here to python. You will need to install the pyglet library from here , as python unfortunately has no built-in animated-gif support. Hope you like it :) import pyglet, sys, os, time def animgif_to_ASCII_animation(animated_gif_path): # map greyscale to characters chars = ('#', '#', '@', '%', '=', '+', '*', ':', '-', '.', ' ') clear_console =

Using Unicode font in C++ console app

余生长醉 提交于 2019-11-30 05:17:55
How do I change the font in my C++ Windows console app? It doesn't seem to use the font cmd.exe uses by default (Lucida Console). When I run my app through an existing cmd.exe (typing name.exe) it looks like this: http://dathui.mine.nu/konsol3.png which is entierly correct. But when I run my app seperatly (double-click the .exe) it looks like this: http://dathui.mine.nu/konsol2.png . Same code, two different looks. So now I wonder how I can change the font so it always looks correctly regardless of how it's run. EDIT: Ok, some more information. When I just use this little snippet:

Set C# console application to Unicode output

妖精的绣舞 提交于 2019-11-30 04:47:56
问题 I have a C# console application, and I was trying to do some ASCII art within it. However, some of the characters I wanted to use are Unicode. So, I was searching the internet/SO and couldn't find a consolidated answer on how to set the console to be Unicode in a C# console application. TDLR: How do I set the console in a C# console application to be Unicode? Edit: I did find this post after searching for something not related to this question. 回答1: It turns out that there are multiple things

How to get Doctrine ORM instance in Symfony2 console application? [duplicate]

▼魔方 西西 提交于 2019-11-30 04:14:54
Possible Duplicate: How can i inject dependencies to Symfony Console commands? I want to make console application, which changes some records from the database (using Cron, every hour). How to get Doctrine ORM instance here? In casual controller, I do this: $this->getDoctrine(); Vitalii Zurian If you extend from ContainerAwareCommand you should be able to get your service $this->getContainer()->get('doctrine'); Here is similar question 来源: https://stackoverflow.com/questions/11709391/how-to-get-doctrine-orm-instance-in-symfony2-console-application

C# console app to send email at scheduled times

旧街凉风 提交于 2019-11-30 03:58:44
I've got a C# console app running on Windows Server 2003 whose purpose is to read a table called Notifications and a field called "NotifyDateTime" and send an email when that time is reached. I have it scheduled via Task Scheduler to run hourly, check to see if the NotifyDateTime falls within that hour, and then send the notifications. It seems like because I have the notification date/times in the database that there should be a better way than re-running this thing every hour. Is there a lightweight process/console app I could leave running on the server that reads in the day's notifications

Unable to read data from the transport connection: The connection was closed error in console application

て烟熏妆下的殇ゞ 提交于 2019-11-30 03:03:23
问题 I have this code in console application and it runs in a loop try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(search); request.Headers.Add("Accept-Language", "de-DE"); request.Method = "GET"; request.Accept = "text/html"; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.ASCII)) { string html = reader.ReadToEnd(); FindForMatch(html, url); } } } catch (Exception ex) {

Exit Code When Unhandled Exception Terminates Execution?

廉价感情. 提交于 2019-11-30 02:51:56
问题 When a C# .Net console application terminates due to an unhandled exception, are there rules determining which exit code is returned or is 255 always used? I haven't been able to find documentation on this. A simple console app that executes throw new Exception() dies with exit code 255. I'd like to know if it's safe to assume that all unhandled exceptions will return this same error code or if there are variations/corner cases I need to be aware of. C:\Temp\> ThrowsExceptionConsoleApp.exe C: