customization

Matplotlib: Repositioning a subplot in a grid of subplots

让人想犯罪 __ 提交于 2019-12-03 06:56:23
I am trying to make a plot with 7 subplots. At the moment I am plotting two columns, one with four plots and the other with three, i.e. like this: I am constructing this plot in the folowing way: #! /usr/bin/env python import numpy as plotting import matplotlib from pylab import * x = np.random.rand(20) y = np.random.rand(20) fig = figure(figsize=(6.5,12)) subplots_adjust(wspace=0.2,hspace=0.2) iplot = 420 for i in range(7): iplot += 1 ax = fig.add_subplot(iplot) ax.plot(x,y,'ko') ax.set_xlabel("x") ax.set_ylabel("y") savefig("subplots_example.png",bbox_inches='tight') However, for publication

Rails: creating a custom data type / creating a shorthand

拜拜、爱过 提交于 2019-12-03 06:47:56
问题 I am wondering how I could create a custom data type to use within the rake migration file. Example: if you would be creating a model, inside the migration file you can add columns. It could look like this: def self.up create_table :products do |t| t.column :name, :string t.timestamps end end I would like to know how to create something like this: t.column :name, :my_custom_data_type The reason for this to create for example a "currency" type, which is nothing more than a decimal with a

Customize Applescript app icon

隐身守侯 提交于 2019-12-03 06:22:55
问题 I have created my AppleScript, tested it, saved it as an .app and it works. Now, how do I set a custom icon for it? I have done a bit of googling and tried a few different things but cannot get it to work. The app is mainly for me and maybe some people I know to make workflows easier so having a nice little icon makes a huge difference. Can anyone help with this please? 回答1: Basically you need an .icns icon file. Open your application with right-click > Show Package Contents Navigate to

Customizing dialog by extending Dialog or AlertDialog

孤街醉人 提交于 2019-12-03 05:49:00
问题 I want to make a custom Dialog . Because I don't like its style, I want to have rounded rectangle rather than sharp corners. I know how to implement it by theme in AndroidManifest.xml , for example, I use: android:theme="@style/Theme.CustomDialog" And Theme.CustomDialog.xml : <style name="Theme.CustomDialog" parent="android:style/Theme.Dialog"> <item name="android:windowBackground">@drawable/filled_box</item> <item name="android:windowNoTitle">true</item> filled_box.xml <shape xmlns:android=

How To Deploy: Installing Mezzanine Theme

北城余情 提交于 2019-12-03 05:13:51
问题 How to install Mezzanine Theme exactly, step-by-step? E.g., Moderna free theme. 回答1: Preconditions: 0) Versioning Python 2.7.6. Django 1.6.10 Mezzanine 3.1.10 Moderna v.? (static content) 1) I used PythonAnywhere for hosting 2) I followed this way to install Mezzanine: here, at the bottom there are links to PythonAnywhere specific guides 3) So, initial state is: Mezzanine is deployed, empty, with default theme. 4) [optional] Basic templates are collected (~80 of them it was) 5) Static is

how do I set Paper Type while using PrinterDialog?

限于喜欢 提交于 2019-12-03 05:06:36
I'm trying to silently print a picture file and i need to print it on special paper type ("Glossy Photo Paper"), and on certain size (10cm on 15cm). On normal windows 7 print dialog i can choose: Paper Size , Paper Quality (for example - "Auto", "High", "Standard", "Custom") Paper Type ("Plain paper", "Glossy photo paper", "Photo Paper Plus Glossy", "Photo Paper Pro Platinum", "Hagaki", etc...) But, through c# code, I've managed to set only the PaperSize (which is 4'' on 6'' == 10cm on 15cm). My problem is how do i get the option to set the Paper Type , and not the PaperSource ("Tray 1", "Tray

VS2012 How to turn off editor tab colouring?

你。 提交于 2019-12-03 04:41:00
问题 I strain to read the tabs in the source code editor of Visual Studio 2012. I don't even understand what the different colors mean? They seem totally random. Black on brown or black on blue.... who choose that? So I would like to turn off the colouring for the tabs and revert to black on white, or a light grey. I've looked in: Options>> Environment (General / Font and Colors) but I cant see anything relevant. So how can I do this please? 回答1: Looks like you might have Productivity Power Tools

Vim: Smart indent when entering insert mode on blank line?

前提是你 提交于 2019-12-03 04:11:58
问题 When I open a new line (via 'o') my cursor jumps to a correctly indented position on the next line. On the other hand, entering insert mode while my cursor is on a blank line doesn't move my cursor to the correctly indented location. How do I make vim correctly indent my cursor when entering insert mode (via i) on a blank line? 回答1: cc will replace the contents of the current line and enter insert mode at the correct indentation - so on a blank line will do exactly what you're after. I

Dynamic GridView items in Android

℡╲_俬逩灬. 提交于 2019-12-03 04:05:59
Hey i'm trying to build an app in which the user can input some numbers and these numbers will be shown in a gridview with custom grid view items. If i use the common gridview items of android it works. But if i use my own layout it doesnt work. Only the first element in the array will be shown. Does anybody have a clou why this doesn't work? public class GridViewAppActivity extends Activity { private ArrayList<String> items; private GridViewAdapter adapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

CakePHP customize flash message

谁说胖子不能爱 提交于 2019-12-03 03:46:47
Normally, the $this->Session->setFlash(__('My message.')); Will output: <div id="flashMessage" class="message"> My message. </div> How can I change that, so it'll output: <p class="notification> My message. </p> instead? If you look at the source code you will see that the second parameter of the SessionComponent method is the name of an element: function setFlash($message, $element = 'default', $params = array(), $key = 'flash') You can create a file in views/elements (or Views/Elements for Cake2) called for instance 'flash_notification.ctp' with the following content: <p class="notification"