minimize

Taskbar Minimize C# Windows Form Problem

大兔子大兔子 提交于 2019-12-13 02:02:03
问题 I have a Windows Form application that, when the form is Activated, Deactivated, or SizeChanged, the form does something. It's rather specific. For example: Form Activated : Will set the variable isActive to true, and focus the input to an input box for someone to enter something too. Form Deactivated : Will set the variable isActive to false, so that any focus changes in the application (caused by remote machine messages, chat messages, etc), does not steal focus from other applications.

Minimize System of Equations with constraints (scipy.optimize.minimize)

对着背影说爱祢 提交于 2019-12-12 02:50:56
问题 The following code: import numpy as np from scipy.optimize import minimize def eq( p ): s1,s2,s3 = p f1 = 1.1**3 / s1*1.1**1+s2*1.1**2+s3*1.1**3 f2 = 0.9**1 / s1*0.9**1+s2*0.9**2+s3*0.9**3 return (f1, f2) bnds = ( (0, None), (0, None), (0, None) ) cons = ( { 'type' : 'ineq', 'fun': lambda p: p[0]+[p1]+[p2] - 1} ) minimize( eq, (0.3,0.3,0.3), bounds=bnds, constraints=cons ) throws the error TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple' I want to minimize f1 and f2 such that

JFrame minimized to dock name “java”

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:06:01
问题 I am displaying a JFrame on OS X and am getting "java" for the name of the application when it is minimized to the dock. I am passing -Xdock:name="Foo" , and this is changing the name in the dock when the application is not minimized, but once we minimize the name in the dock is wrong. To minimize I am calling setExtendedState(JFrame.ICONIFIED) . 回答1: To get this effect on Mac OS X, you'll need to add the option to your application bundle's Info.plist , as shown in the example cited here.

Vista live thumbnail issue with SetWindowRgn

妖精的绣舞 提交于 2019-12-11 18:14:13
问题 I know I am probably missing something, but I can't seem to get windows to show the live thumbnail preview correctly when using a window that has a region. When hitting the minimize button the preview will clip to the minimized size (160x25) rather than showing the full preview (like it does with other windows). Few points to make: 1) The preview works fine in Windows Live Messenger, so Microsoft figured out a way to do it. 2) If I call SetWindowRgn only before a window is visible, it works

How to start Outlook minimized?

被刻印的时光 ゝ 提交于 2019-12-11 08:12:04
问题 I think starting a process minimized should be simple but I had no luck with outlook. How can I start Outlook minimized? My attempt was this: [DllImport("user32.dll")] private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); static void Main(string[] args) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "OUTLOOK.EXE"; IntPtr hWnd = Process.Start(startInfo).Handle; bool state = false; if (!hWnd.Equals(IntPtr.Zero)) state = ShowWindowAsync(hWnd, 2); //

How to set optimization variable resolution in scipy.optimize.minimize

半腔热情 提交于 2019-12-11 07:24:45
问题 Background: A ship is berthed to a jetty using 24 mooring lines and 4 fenders. These mooring lines needs to be pre-tensioned to a design value by experienced engineers. Pre-tensioning is done by setting the appropriate length of each mooring line. Static simulation is done to obtain tension on the lines and compression on the fenders. This is an iterative process as small change in mooring line lenght may cause significant variation in the tension. Problem Description: An objective function

Single big cache-able CSS vs page-specific small CSS snippets

陌路散爱 提交于 2019-12-11 05:57:52
问题 Right now my CSS files look like this: Then I have a php snippet that looks like this: <?php $Compress->folder(Configuration::get('Public').'/style/', '.css', Configuration::get('Public').'/style.css'); ?> This minimizes all the css files stored in the directory public_html/style/ (shown in the picture) and creates a file in the directory /public_html/ called style.css. It is run only when needed, although in development, always. Then I just include the big file: <link rel="stylesheet" href=

Hook to detect Minimize Window C#

流过昼夜 提交于 2019-12-11 03:05:43
问题 Hi all How can I detect in C # that the user clicked on the minimize button of an external program (eg notepad)? Thanks 回答1: This should work: public class myClass { [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl); const UInt32 SW_HIDE = 0; const UInt32 SW_SHOWNORMAL = 1; const UInt32 SW_NORMAL = 1; const UInt32 SW_SHOWMINIMIZED = 2; const UInt32 SW_SHOWMAXIMIZED = 3; const UInt32 SW_MAXIMIZE = 3

Minimization of convex stochastic values

此生再无相见时 提交于 2019-12-10 22:46:12
问题 I have a variable of equidistant values (suppose values=0:1e-3:1 ). I want to get the value and its correspondent index from values which is closest to a uniformly random value (suppose x=rand ). I could do [value,vIdx]=min(abs(values-x)) , which would be the simplest minimization I could do. Unfortunately the min function won't take advantage from one property from the data, that is to be convex . I don't need to search all indexes, because as soon as find an index that is no more lesser

Scipy.minimize - “TypeError: numpy.float64' object is not callable running”

北城余情 提交于 2019-12-10 20:01:17
问题 Running the scipy.minimize function "I get TypeError: 'numpy.float64' object is not callable". Specifically during the execution of: .../scipy/optimize/optimize.py", line 292, in function_wrapper return function(*(wrapper_args + args)) I already looked at previous similar topics here and usually this problem occurs due to the fact that as first input parameter of .minimize is not a function. I have difficulties in figure it out, because "a" is function. What do you think? ### "data" is a