Search Results

Search found 50 results on 2 pages for 'hekevintran'.

Page 1/2 | 1 2  | Next Page >

  • Delete until previous punctuation mark in Bash

    - by hekevintran
    In Bash, Ctrl + W will erase the last word. Bash considers words to be delimited by spaces. This means that if the cursor is at the end of the string "cd /dir1/dir2/dir3" and you hit Ctrl + W you will be left with "cd ". Is there a Bash shortcut (custom defined is okay) that will leave me with "cd /dir1/dir2/"?

    Read the article

  • Autologin on Ubuntu Server

    - by hekevintran
    I have a machine running Ubuntu Server. It has only a command-line interface. How can I make the system login with a specific user automatically (I don't want to type the username/password). I know that this is insecure and I don't care.

    Read the article

  • Syntax for find on Mac OS X

    - by hekevintran
    I have a project directory that contains source code and subdirectories of source code. I want to use the Unix program find to search recursively for the names of files of certain extensions. The versions of find on Linux and Mac OS X behave differently. # Works in Linux find . -type f -regex ".*\.\(py\|html\)$" # Neither of these works in Mac OS X find . -type f -regex ".*\.\(py\|html\)$" find . -type f -regex ".*\.(py|html)$" How do I write this command so that it will run on Mac OS X (and hopefully on Linux too)?

    Read the article

  • Command line is horribly slow in Ubuntu Server

    - by hekevintran
    I am running Ubuntu Server on VirtualBox. I am not using X Windows, only the command line. It looks like it is redrawing the screen for every line that causes the screen to shift down. In other words if there is empty space on the screen below the current line, it works normally, but if the current line is at the bottom of the screen, when the system moves to the next line it refreshes the whole screen line by line. This causes the system to run very slowly because I have to wait for the whole screen to refresh for every line and it hits the CPU at 90%. I installed Debian Lenny in VirtualBox and it didn't do this. Why does Ubuntu Server redraw the screen for each line? Is there a way to make this behaviour go away?

    Read the article

  • Changing dual-monitor settings without closing the laptop lid on OS X

    - by hekevintran
    I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to wake it up again. Because the machine is being woken up with the lid closed, when the displays are detected the system finds only the external. After the system is functional again, you can open the lid if you want and the laptop screen will be non-functional until you either tell the system to detect displays from the system preferences or you turn off the external display. Every time I want to use only the external display, I must reach my hand over to close the lid, wait for the machine to sleep, jigger the mouse, wait for the machine to wake up, and finally open the lid again because I don't want the machine to overheat. I feel that this is very stupid to have to do. Why is there no button or menu option that says "don't use this screen"? Is there any third-party software way to change the screen setup that does not involve physically closing the lid and playing a game of "are you sleeping" in order to switch such a simple software setting? We are in the 21st Century and honestly this is childish.

    Read the article

  • Authenticating a Windows client to a Samba share

    - by hekevintran
    I have a Samba network share being served by a Linux machine. The share is read-only unless you give it a username and password. I want my Windows 7 client machine to connect to it. It appears that the Windows machine is connecting as a guest because it does not have write access. The Windows machine never asks me whether or not it should connect as a guest or with a username. How do I make the Windows machine authenticate? Where do I input my password? This seems like such a simple thing yet I am totally confused. On Mac OS and Linux, it simply asks you for a username.

    Read the article

  • Viewing the full Skype chat history

    - by hekevintran
    I have Skype 2.8 on Mac OS X 10.5.8. Under the the chat menu is an option called "Recent Chats". This allows me to see logs of recent chats, but not of older ones. I know the older ones are stored because they are in ~/Library/Application Support/Skype/username/chatmsg256.dbb. This file when put in a text editor has text chat information from all my previous Skype chats. It is however stored in an unknown file format that I do not know how to parse. Does Skype have a built-in log viewer (like Adium's) that I can use to access these older logs?

    Read the article

  • Running a Linux virtual machine on Windows 7

    - by hekevintran
    I want to do two things: Set up a virtual machine on Windows 7 to run Ubuntu Set up a way for the virtual machine to read the windows disk or windows to have read/write access to the virtual machine's disk. My goal is to have a place where both Ubuntu and Windows can read and write. What software is good for this task? Are their free programs that can run virtual machines? Also if my machine is running Windows 7 64-bit, can I install Ubuntu 32-bit? Or am I forced to use Ubuntu 64-bit? Or does it not matter?

    Read the article

  • Is there a method to export the URLs of the open tabs of a Firefox window?

    - by hekevintran
    If I have a Firefox window open that contains 10 tabs, is there a way in Firefox or by a plug-in to get the URLs of those 10 tabs as a text file or some other format? Right now if I want to do this I need to copy the URL of tab A, paste it somewhere, move to tab B, and repeat. I could also bookmark all the tabs into a folder and export that, but that seems like such a hassle. If there is no such method, could someone point me to some documents that describe the basics of writing a Firefox plug-in. I am willing to write this myself if there is no "standard" way.

    Read the article

  • Adding hooks to TortoiseHg

    - by hekevintran
    I am using TortoiseHg and would like to apply a hook to my repo. My repo's .hg/hgrc file is as follows: [hooks] pretxncommit = python:hg_checksize.newbinsize The thing is that I don't know where TortoiseHg's PYTHONPATH variable is set. How do I change it? Or where do I put my Python file so that it is visible by TortoiseHg's Python interpreter? I cannot find any mention of hooks in TortoiseHg's documentation or through Google?

    Read the article

  • Does JavaScript's for in loop iterate over methods?

    - by hekevintran
    In an article on yuiblog Douglas Crockford says that the for in statement will iterate over the methods of an object. Why does the following code not produce ["a", "b", "c", "d", "toString"]? Aren't .toString() and other methods members of my_obj? Object.prototype.toString = function(){return 'abc'} Object.prototype.d = 4; my_obj = { 'a':1, 'b':2, 'c':3 } a = [] for (var key in my_obj) { a.push(key) } console.log(a) // prints ["a", "b", "c", "d"]

    Read the article

  • Emacs recursive project search

    - by hekevintran
    I am switching to Emacs from TextMate. One feature of TextMate that I would really like to have in Emacs is the "Find in Project" search box that uses fuzzy matching. Emacs sort of has this with ido, but ido does not search recursively through child directories. It searches only within one directory. Is there a way to give ido a root directory and to search everything under it? Update: The questions below pertain to find-file-in-project.el from Michal Marczyk's answer. If anything in this message sounds obvious it's because I have used Emacs for less than one week. :-) As I understand it, project-local-variables lets me define things in a .emacs-project file that I keep in my project root. How do I point find-file-in-project to my project root? I am not familiar with regex syntax in Emacs Lisp. The default value for ffip-regexp is: ".*\\.\\(rb\\|js\\|css\\|yml\\|yaml\\|rhtml\\|erb\\|html\\|el\\)" I presume that I can just switch the extensions to the ones appropriate for my project. Could you explain the ffip-find-options? From the file: (defvar ffip-find-options "" "Extra options to pass to `find' when using find-file-in-project. Use this to exclude portions of your project: \"-not -regex \\".vendor.\\"\"") What does this mean exactly and how do I use it to exclude files/directories? Could you share an example .emacs-project file?

    Read the article

  • Unable to run winpdb

    - by hekevintran
    I tried to run winpdb.py, but I got an error saying that it could not find wxPython. This is strange to me because I know I have wxPython installed and included in my PYTHONPATH. I can import wx in the Python interpreter. Mac OS X 10.5.8 Python 2.6 PYTHONPATH=/sw/lib/python2.6/site-packages/:/usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode: $ python winpdb.py wxPython was not found. wxPython 2.6 or higher is required to run the winpdb GUI. wxPython is the graphical user interface toolkit used by Winpdb. You can find more information on wxPython at http://www.wxpython.org/ The Unicode version of wxPython is recommended for Winpdb. To use the debugger without a GUI, run rpdb2. What could be causing this?

    Read the article

  • Producing an view of a text's revision history in Python

    - by hekevintran
    I have two versions of a piece of text and I want to produce an HTML view of its revision similar to what Google Docs or Stack Overflow displays. I need to do this in Python. I don't know what this technique is called but I assume that it has a name and hopefully there is a Python library that can do it. Version 1: William Henry "Bill" Gates III (born October 28, 1955)[2] is an American business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. Version 2: William Henry "Bill" Gates III (born October 28, 1955)[2] is a business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. He is American. The desired output: William Henry "Bill" Gates III (born October 28, 1955)[2] is an American business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. He is American. Using the diff command doesn't work because it tells me which lines are different but not which columns/words are different. $ echo 'William Henry "Bill" Gates III (born October 28, 1955)[2] is an American business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen.' > oldfile $ echo 'William Henry "Bill" Gates III (born October 28, 1955)[2] is a business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. He is American.' > newfile $ diff -u oldfile newfile --- oldfile 2010-04-30 13:32:43.000000000 -0700 +++ newfile 2010-04-30 13:33:09.000000000 -0700 @@ -1 +1 @@ -William Henry "Bill" Gates III (born October 28, 1955)[2] is an American business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. +William Henry "Bill" Gates III (born October 28, 1955)[2] is a business magnate, philanthropist, and chairman[3] of Microsoft, the software company he founded with Paul Allen. He is American.' > oldfile

    Read the article

  • Mercurial hook to disallow committing large binary files

    - by hekevintran
    I want to have a Mercurial hook that will run before committing a transaction that will abort the transaction if a binary file being committed is greater than 1 megabyte. I found the following code which works fine except for one problem. If my changeset involves removing a file, this hook will throw an exception. The hook (I'm using pretxncommit = python:checksize.newbinsize): from mercurial import context, util from mercurial.i18n import _ import mercurial.node as dpynode '''hooks to forbid adding binary file over a given size Ensure the PYTHONPATH is pointing where hg_checksize.py is and setup your repo .hg/hgrc like this: [hooks] pretxncommit = python:checksize.newbinsize pretxnchangegroup = python:checksize.newbinsize preoutgoing = python:checksize.nopull [limits] maxnewbinsize = 10240 ''' def newbinsize(ui, repo, node=None, **kwargs): '''forbid to add binary files over a given size''' forbid = False # default limit is 10 MB limit = int(ui.config('limits', 'maxnewbinsize', 10000000)) tip = context.changectx(repo, 'tip').rev() ctx = context.changectx(repo, node) for rev in range(ctx.rev(), tip+1): ctx = context.changectx(repo, rev) print ctx.files() for f in ctx.files(): fctx = ctx.filectx(f) filecontent = fctx.data() # check only for new files if not fctx.parents(): if len(filecontent) > limit and util.binary(filecontent): msg = 'new binary file %s of %s is too large: %ld > %ld\n' hname = dpynode.short(ctx.node()) ui.write(_(msg) % (f, hname, len(filecontent), limit)) forbid = True return forbid The exception: $ hg commit -m 'commit message' error: pretxncommit hook raised an exception: apps/helpers/templatetags/include_extends.py@bced6272d8f4: not found in manifest transaction abort! rollback completed abort: apps/helpers/templatetags/include_extends.py@bced6272d8f4: not found in manifest! I'm not familiar with writing Mercurial hooks, so I'm pretty confused about what's going on. Why does the hook care that a file was removed if hg already knows about it? Is there a way to fix this hook so that it works all the time? Update (solved): I modified the hook to filter out files that were removed in the changeset. def newbinsize(ui, repo, node=None, **kwargs): '''forbid to add binary files over a given size''' forbid = False # default limit is 10 MB limit = int(ui.config('limits', 'maxnewbinsize', 10000000)) ctx = repo[node] for rev in xrange(ctx.rev(), len(repo)): ctx = context.changectx(repo, rev) # do not check the size of files that have been removed # files that have been removed do not have filecontexts # to test for whether a file was removed, test for the existence of a filecontext filecontexts = list(ctx) def file_was_removed(f): """Returns True if the file was removed""" if f not in filecontexts: return True else: return False for f in itertools.ifilterfalse(file_was_removed, ctx.files()): fctx = ctx.filectx(f) filecontent = fctx.data() # check only for new files if not fctx.parents(): if len(filecontent) > limit and util.binary(filecontent): msg = 'new binary file %s of %s is too large: %ld > %ld\n' hname = dpynode.short(ctx.node()) ui.write(_(msg) % (f, hname, len(filecontent), limit)) forbid = True return forbid

    Read the article

  • Activating Eclipse Django Editor on OS X

    - by hekevintran
    I installed a plugin for Eclipse called Django Editor. I can't figure out how to use it. The editor is not in my list of editors so I cannot do "Open with Django Editor" on a file nor associate a file extension with it. It appears nowhere in my preferences. How can I activate this editor? I am running Mac OS X 10.5.8 and Eclipse 3.5.2 Galileo.

    Read the article

  • Firefox add-on for examining z-indexes

    - by hekevintran
    I'm working on a fairly large site and am having trouble managing z-indexes. Is there a Firefox add-on that will look at a page and give me an ordered list of every element with a z-index declared? That would save a ton of times for the cases where a z-index was wrong or hard to find.

    Read the article

  • "Go to file" feature in various editors

    - by hekevintran
    In TextMate there is a feature called "Go to file" that is used for file navigation. It is a box where you type the name of a file in your project and it will use fuzzy matching to generate a list of candidates files from which you can select. Other editors have this feature, but they each give it a different name: Vim fuzzyfinder Emacs fuzzy-find-in-project TextMate Go to file (fuzzy) Eclipse OpenResource (not fuzzy) Eclipse GotoFile (fuzzy) Komodo Go to File (not fuzzy) Netbeans Go to file (not fuzzy) Does jEdit, Geany, or Ultraedit have this feature?

    Read the article

  • Is there a way to put relationships/contraints into CSS?

    - by hekevintran
    In every design tool or art principle I've heard of, relationships are a central theme. By relationships I mean the thing you can do in Adobe Illustrator to specify that the height of one shape is equal to half the height of another. You cannot express this information in CSS. CSS hard-codes all values. Using a language like LESS that allows variables and arithmetic you can get closer to relationships but it's still a CSS variant. This inability in my mind is the biggest problem with CSS. CSS is supposed to be a language that describes the visual component of a Web page but it ignores relationships and contraints, ideas that are at the core of art. How possible is it to imagine a new Web design language that can express relationships and contraints that can be implemented in JavaScript using the current CSS properties?

    Read the article

  • Is there a Django template tag that lets me set a context variable?

    - by hekevintran
    I want to be able to set variables in a template to string values. I wrote a tag, but it doesn't seem to change the context. The intended use is: {% define my_var as "a string" %} class DefineNode(Node): def __init__(self, value, variable_name, nodelist): self.value = value self.variable_name = variable_name self.nodelist = nodelist def __repr__(self): return "<DefineNode>" def render(self, context): context[self.variable_name] = self.value return '' @register.tag def define(parser, token): bits = list(token.split_contents()) if len(bits) != 4: raise TemplateSyntaxError("%r expected format is 'value as variable'" % bits[0]) if bits[1][0] in ('"', "'") and bits[1][-1] == bits[1][0]: value = bits[1][1:-1] nodelist = parser.parse(('enddefine',)) parser.delete_first_token() return DefineNode(value, bits[3], nodelist) I

    Read the article

  • Django database caching

    - by hekevintran
    The object user has a foreign key relationship to address. Is there a difference between samples 1 and 2? Does sample 1 run the query multiple times? Or is the address object cached? # Sample 1 country = user.address.country city = user.address.city state = user.address.state # Sample 2 address = user.address country = address.country city = address.city state = address.state

    Read the article

1 2  | Next Page >