console-application

Python PSS/E get output as variable

旧巷老猫 提交于 2019-12-20 04:54:36
问题 I am power engineer and I often use python in PSS/E program. I am stacked and I want your help as programmers. I have this small code: import os,sys PSSE_LOCATION = r"C:\Program Files\PTI\PSSE33\PSSBIN" sys.path.append(PSSE_LOCATION) os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION import psspy import redirect redirect.psse2py() #-------------------------------- # PSS/E Saved case CASE = r"""D:\xxx\Desktop\TESTING\SUMMAX.sav""" if __name__ == '__main__': psspy.psseinit(2000)

JTextArea as console

こ雲淡風輕ζ 提交于 2019-12-20 04:45:30
问题 I have posted two pieces of code below. Both codes work fine individually. Now, when I run the file Easy, and click on the "Start" button, I want the class AddNumber to be implemented. I mean to say that, instead of the AddNumber running on the console, is there any way I could make AddNumber run in the JTextArea i have created in the first class upon clicking the "Start" button? I thought maybe by action listener?(the way we do in case of buttons) But I'm not sure. Is there any other way to

In dotnet core how can I ensure only one copy of my application is running?

↘锁芯ラ 提交于 2019-12-20 04:15:08
问题 In the past I have done something like this private static bool AlreadyRunning() { var processes = Process.GetProcesses(); var currentProc = Process.GetCurrentProcess(); logger.Info($"Current proccess: {currentProc.ProcessName}"); foreach (var process in processes) { if (currentProc.ProcessName == process.ProcessName && currentProc.Id != process.Id) { logger.Info($"Another instance of this process is already running: {process.Id}"); return true; } } return false; } Which has worked well. In

Non-blocking read of stdin?

蹲街弑〆低调 提交于 2019-12-20 03:10:14
问题 I need to have my form-based application check stdin periodically for input, but still perform other processing. Scripting.TextStream.Read() and the ReadFile() API are blocking, is there a non-blocking method of reading stdin in VB6? With Timer1 set to fire every 100 ms, I've tried: Private Declare Function AllocConsole Lib "kernel32" () As Long Private Declare Function FreeConsole Lib "kernel32" () As Long Dim sin As Scripting.TextStream Private Sub Form_Load() AllocConsole Dim FSO As New

Why is the _bin_DeployableAssemblies folder specific to web applications?

被刻印的时光 ゝ 提交于 2019-12-20 02:55:32
问题 The _bin_DeployableAssemblies folder was added in VS 2010 SP1 as a common way to pull in assemblies for which no hard dependency exists. I believe it was originally added as a way to allow folks to bin-deploy MVC, but it seems useful in environments outside of web applications. In particular, a lot of inversion of control scenarios will result in loosely coupled components that don't require a hard reference, but still require dependent assemblies to be located (usually in the bin directory).

.NET Core 2 Console App Dependencies Issue on Azure

删除回忆录丶 提交于 2019-12-20 02:51:02
问题 Short version of the problem: I'm having difficulties including the assemblies my .NET Core Console App depends on. Initially, the assemblies from NuGet packages were not included in the bin folder even though I could run the app in Debug mode without any problems. Found an article that suggested that I should add <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> in the myapp.csproj file which I did. Doing so included the dll files for the NuGet packages in the bin folder BUT

Rewriting characters in command window

家住魔仙堡 提交于 2019-12-20 02:49:39
问题 I want to output some characters in C# console application and then rewrite them, thus changing characters in position already occupied in command window. So for for example I could show progress in percentages 10%, 20%, 30% (but in the same place). How can I do that? 回答1: Have a look at Writing string at the same position using Console.Write in C# 2.0 Console.SetCursorPosition Method Console.CursorLeft Property Console.CursorTop Property 回答2: If you print a '\r' character, the cursor will

Unresolved external symbol _declspec(dllimport)

╄→гoц情女王★ 提交于 2019-12-20 02:38:51
问题 I've created an DLL for my Console Application in Visual Studio. In my DLL I have a Class named Dialog_MainMenu with has a *.cpp file and a *.h file. Following error message : Error 9 error LNK2001: unresolved external symbol "__declspec(dllimport) public: static enum Dialog_MainMenu::GAME_STATES Dialog_MainMenu::CurrentGameState" (_ imp ?CurrentGameState@Dialog_MainMenu@@2W4GAME_STATES@1@A) C:\Users\Kevin\Desktop\c++ projects\development_testing\The Intense Adventure\Dialogs\Dialog_MainMenu

RestSharp response unauthorized

Deadly 提交于 2019-12-20 01:46:54
问题 I am new to web based solutions. I am hitting a rest url using RestSharp library. My code is as follows: var cleint = new RestClient("http://REST_URL"); cleint.Authenticator = new HttpBasicAuthenticator("username", "password"); var request = new RestRequest(); request.Method = Method.GET; request.Resource = "0.json"; IRestResponse response = cleint.Execute(request); if (response != null && ((response.StatusCode == HttpStatusCode.OK) && (response.ResponseStatus == ResponseStatus.Completed))) {

RestSharp response unauthorized

妖精的绣舞 提交于 2019-12-20 01:46:06
问题 I am new to web based solutions. I am hitting a rest url using RestSharp library. My code is as follows: var cleint = new RestClient("http://REST_URL"); cleint.Authenticator = new HttpBasicAuthenticator("username", "password"); var request = new RestRequest(); request.Method = Method.GET; request.Resource = "0.json"; IRestResponse response = cleint.Execute(request); if (response != null && ((response.StatusCode == HttpStatusCode.OK) && (response.ResponseStatus == ResponseStatus.Completed))) {