Search Results

Search found 6 results on 1 pages for 'headcrab'.

Page 1/1 | 1 

  • Exclude an input language from Alt+Shift/Ctrl+Shift switching cycle on Windows

    - by Headcrab
    I have 3 input languages installed on my Windows 7: English, Russian and Japanese. So when I switch between them by Ctrl+Shift, they go like English - Russian - Japanese - English - ... I don't use Japanese much, but still need it occasionally. Is there a way to somehow exclude it from the "Ctrl+Shift cycle" without uninstalling it from the system? E. g. Ctrl+Shift will be like English - Russian - English - ..., while I still could switch to Japanese by a dedicated keyboard shortcut, say, Ctrl + 3? That extra Ctrl+Shift to go through Japanese just to switch between English and Russian is very annoying, and using Ctrl+1, Ctrl+2, Ctrl+3 for each input language isn't very ergonomic, either.

    Read the article

  • ropemacs USAGE tutorial

    - by Headcrab
    There are many sites with instructions on installing ropemacs, but so far I couldn't find any with instructions on how to use it after it's already installed. I have it installed, or at least it seems so, Emacs has "Rope" menu in it's top menu bar. Now what? So far I could use only "Show documentation" (C-c d by default). An attempt to use code assist (which is auto-complete, I presume?) only causes Emacs to ask about "Rope project root folder" (what's that?) in the minibuffer and then showing nothing. So, once ropemacs is installed, what are the steps to see it in action on some simple python scripts? Something like "if you have this script in your emacs and put the blinking square here and press this, it does that" would be an answer. (I've been thinking if I should ask this or not for some time, because nobody else seem to have the same problem, so I thought asking this question will make me look somewhat retarded. But, after all, it's usually better to ask it and and look like a retard than not to ask it and do like a retard...)

    Read the article

  • List of objects or parallel arrays of properties?

    - by Headcrab
    The question is, basically: what would be more preferable, both performance-wise and design-wise - to have a list of objects of a Python class or to have several lists of numerical properties? I am writing some sort of a scientific simulation which involves a rather large system of interacting particles. For simplicity, let's say we have a set of balls bouncing inside a box so each ball has a number of numerical properties, like x-y-z-coordinates, diameter, mass, velocity vector and so on. How to store the system better? Two major options I can think of are: to make a class "Ball" with those properties and some methods, then store a list of objects of the class, e. g. [b1, b2, b3, ...bn, ...], where for each bn we can access bn.x, bn.y, bn.mass and so on; to make an array of numbers for each property, then for each i-th "ball" we can access it's 'x' coordinate as xs[i], 'y' coordinate as ys[i], 'mass' as masses[i] and so on; To me it seems that the first option represents a better design. The second option looks somewhat uglier, but might be better in terms of performance, and it could be easier to use it with numpy and scipy, which I try to use as much as I can. I am still not sure if Python will be fast enough, so it may be necessary to rewrite it in C++ or something, after initial prototyping in Python. Would the choice of data representation be different for C/C++? What about a hybrid approach, e.g. Python with C++ extension?

    Read the article

  • How does functional programming work?

    - by Headcrab
    I'm used to imperative/OO programming (know C, C++, Python, PHP, etc.). I wanted to get into functional programming but there are some things unclear to me. Take for example the languages F# and Haskell: How do you implement loops? By recursion? Eew. What about conditions? How can you get by without variables? I mean.. What do we have RAM for.. storing variables, right?

    Read the article

  • matplotlib.pyplot, preserve aspect ratio of the plot

    - by Headcrab
    Assuming we have a polygon coordinates as polygon = [(x1, y1), (x2, y2), ...], the following code displays the polygon: import matplotlib.pyplot as plt plt.fill(*zip(*polygon)) plt.show() By default it is trying to adjust the aspect ratio so that the polygon (or whatever other diagram) fits inside the window, and automatically changing it so that it fits even after resizing. Which is great in many cases, except when you are trying to estimate visually if the image is distorted. How to fix the aspect ratio to be strictly 1:1? (Not sure if "aspect ratio" is the right term here, so in case it is not - I need both X and Y axes to have 1:1 scale, so that (0, 1) on both X and Y takes an exact same amount of screen space. And I need to keep it 1:1 no matter how I resize the window.)

    Read the article

  • Django comments form validation, check if the comment is from authenticated user

    - by Headcrab
    I wanted to add reCaptcha to the comment form, but only for non-authenticated users. I've created my own comments app, using reCaptcha more or less according to this post, except that I don't have any (explicit) view function to post the comment, but instead I check captcha as a part of form validation process. Everything works fine so far. Now, how do I disable reCaptcha for a logged in user? Removing all reCaptcha-related fields in the template is no problem, but how do I validate the form, not checking captcha if the comment if from an authenticated user? Alternatively, is there a way to use two different comment form classes, depending on whether the user is authenticated or not?

    Read the article

1