Restrict scipy.optimize.minimize to integer values

pulp solution After some research, I don’t think your objective function is linear. I recreated the problem in the Python pulp library but pulp doesn’t like that we’re dividing by a float and ‘LpAffineExpression’. This answer suggests that linear programming “doesn’t understand divisions” but that comment is in context of adding constraints, not the objective … Read more

How can I automatically compress and minimize JavaScript files in an ASP.NET MVC app?

I personally think that keeping the files separate during development is invaluable and that during production is when something like this counts. So I modified my deployment script in order to do that above. I have a section that reads: <Target Name=”BeforeDeploy”> <ReadLinesFromFile File=”%(JsFile.Identity)”> <Output TaskParameter=”Lines” ItemName=”JsLines”/> </ReadLinesFromFile> <WriteLinesToFile File=”Scripts\all.js” Lines=”@(JsLines)” Overwrite=”true”/> <Exec Command=”java -jar … Read more

How to hide a JFrame in system tray of taskbar

import java.awt.*; import java.awt.event.*; import javax.swing.JFrame; import javax.swing.UIManager; /** * * @author Mohammad Faisal * ermohammadfaisal.blogspot.com * facebook.com/m.faisal6621 * */ public class HideToSystemTray extends JFrame{ TrayIcon trayIcon; SystemTray tray; HideToSystemTray(){ super(“SystemTray test”); System.out.println(“creating instance”); try{ System.out.println(“setting look and feel”); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }catch(Exception e){ System.out.println(“Unable to set LookAndFeel”); } if(SystemTray.isSupported()){ System.out.println(“system tray supported”); tray=SystemTray.getSystemTray(); Image image=Toolkit.getDefaultToolkit().getImage(“/media/faisal/DukeImg/Duke256.png”); ActionListener … Read more

Easiest way to have a program minimize itself to the system tray using .NET 4

Example in MSDN forum Here’s a quick example to show how to minimize to the notification area. You need to add references to the System.Window.Forms and System.Drawing assemblies. public partial class Window1 : System.Windows.Window { public Window1() { InitializeComponent(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon(“Main.ico”); ni.Visible = true; ni.DoubleClick += delegate(object sender, … Read more

How to restore a minimized Window in code-behind?

Not sure this will work for everybody, but I ran into this today and someone on the team suggested “have you tried Normal“? Turns out he was right. The following seems to nicely restore your window: if (myWindow.WindowState == WindowState.Minimized) myWindow.WindowState = WindowState.Normal; That works just fine, restoring the window to Maximized if needed. It … Read more

What do you use to minimize and compress JavaScript libraries? [closed]

I’ve used YUI Compressor for a long time and have had no problems with it, but have recently started using Google Closure Compiler and had some success with it. My impressions of it so far: It generally outperforms YUI Compressor in terms of file size reduction. By a small amount on simple mode, and by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)