Search Results

Search found 14 results on 1 pages for 'beeband'.

Page 1/1 | 1 

  • Is there a program that can colourize the output of any linux command?

    - by BeeBand
    Or would I have to write my own? What's the best language for building a tool of this kind? I'm kind of new to linux, but I'm guessing that you could pass the output of a program to a particular script and have it display it in various colours, based on some regular expressions (constructed from some kind of config file perhaps). Or has it been done already...?

    Read the article

  • how to pass an xml file to lxml to parse?

    - by BeeBand
    I'm trying to parse an xml file using lxml. xml.etree allowed me to simply pass the file name as a parameter to the parse function, so I attempted to do the same with lxml. My code: from lxml import etree from lxml import objectify file = "C:\Projects\python\cb.xml" tree = etree.parse(file) but I get the error: Traceback (most recent call last): File "cb.py", line 5, in <module> tree = etree.parse(file) File "lxml.etree.pyx", line 2698, in lxml.etree.parse (src/lxml/lxml.etree.c:4 9590) File "parser.pxi", line 1491, in lxml.etree._parseDocument (src/lxml/lxml.etre e.c:71205) File "parser.pxi", line 1520, in lxml.etree._parseDocumentFromURL (src/lxml/lx ml.etree.c:71488) File "parser.pxi", line 1420, in lxml.etree._parseDocFromFile (src/lxml/lxml.e tree.c:70583) File "parser.pxi", line 975, in lxml.etree._BaseParser._parseDocFromFile (src/ lxml/lxml.etree.c:67736) File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDo c (src/lxml/lxml.etree.c:63820) File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.e tree.c:64741) File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etr ee.c:64084) lxml.etree.XMLSyntaxError: AttValue: " or ' expected, line 2, column 26 What am I doing wrong?

    Read the article

  • Dijkstra's algorithm: why does it work? (not how)

    - by BeeBand
    I understand what Dijkstra's algorithm is but I don't understand why it works. When selecting the next vertice to examine, why does Dijkstra's algorithm select the one with the smallest weight? Why not just select a vertex arbitrarily, since the algorithm visits all vertices anyway?

    Read the article

  • Python question, how to pass an xml file to lxml to parse?

    - by BeeBand
    I'm relatively new to python, my code is: from lxml import etree from lxml import objectify file = "C:\Projects\python\cb.xml" tree = etree.parse(file) but I get the error: Traceback (most recent call last): File "cb.py", line 5, in <module> tree = etree.parse(file) File "lxml.etree.pyx", line 2698, in lxml.etree.parse (src/lxml/lxml.etree.c:4 9590) File "parser.pxi", line 1491, in lxml.etree._parseDocument (src/lxml/lxml.etre e.c:71205) File "parser.pxi", line 1520, in lxml.etree._parseDocumentFromURL (src/lxml/lx ml.etree.c:71488) File "parser.pxi", line 1420, in lxml.etree._parseDocFromFile (src/lxml/lxml.e tree.c:70583) File "parser.pxi", line 975, in lxml.etree._BaseParser._parseDocFromFile (src/ lxml/lxml.etree.c:67736) File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDo c (src/lxml/lxml.etree.c:63820) File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.e tree.c:64741) File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etr ee.c:64084) lxml.etree.XMLSyntaxError: AttValue: " or ' expected, line 2, column 26 What am I doing wrong?

    Read the article

  • Can I monitor traffic on my Incoming Dialup connection using Wireshark?

    - by BeeBand
    Hi, I am trying to create a RAS server in XP Pro. The idea is to log in to this server via a dialup connection. I have set up a new network connection via the New Connect Wizard in XP - according to this tutorial on techrepublic. I am sure that the modem and the connection is working, I have tested it. However, I want to monitor incoming network traffic on this connection. So I thought I would use Wireshark. The problem is that Wireshark does not list this incoming connection on the front page. It lists all my other network connections, ( e.g. my ethernet connection ) but not this one. Whats the best way to monitor traffic on this connection?

    Read the article

  • Why aren't these shared_ptrs pointing to the same container?

    - by BeeBand
    I have a class Model: class Model { ... boost::shared_ptr<Deck> _deck; boost::shared_ptr<CardStack> _stack[22]; }; Deck inherits from CardStack. I tried to make _stack[0] point to the same thing that _deck points to by going: { _deck = boost::shared_ptr<Deck>(new Deck()); _stack[0] = _deck; } It seems that the assignment to _deck of _stack[0] results in a copy of _deck being made. How can I get them to point to the same thing?

    Read the article

  • Re-adjusting a binary heap after removing the minimum element

    - by BeeBand
    After removing the minimum element in a binary heap, i.e. after removing the root, why is the last leaf then assigned to the root and sifted down? Why not take the lesser child of what used to be the root and just keep sifting up all the children? Isn't this the same amount of operations, so why is the "sift down" method preferred?

    Read the article

  • Finding the maximum weight subsequence of an array of positive integers?

    - by BeeBand
    I'm tring to find the maximum weight subsequence of an array of positive integers - the catch is that no adjacent members are allowed in the final subsequence. The exact same question was asked here, and a recursive solution was given by MarkusQ. He provides an explanation, but can anyone help me understand how he has expanded the function? How does this solution take into consideration non-adjacent members?

    Read the article

  • How to print an Objectified Element?

    - by BeeBand
    I have xml of the format: <channel> <games> <game slot='1'> <id>Bric A Bloc</id> <title-text>BricABloc Hoorah</title-text> <link>Fruit Splat</link> </game> </games> </channel> I've parsed this xml using lxml.objectify, via: tree = objectify.parse(file) There will potentially be a number of <game>s underneath <games>. I understand that I can generate a list of <game> objects via: [ tree.games[0].game[0:4] ] My question is, what class are those objects and is there a function to print any object of whatever class these objects belong to?

    Read the article

  • Why am I getting "too many include files : depth = 1024"?

    - by BeeBand
    I'm using Visual Studio 2008 Express edition, and keep getting the following error: "Cascadedisplay.h(4) : fatal error C1014: too many include files : depth = 1024. Obviously I'm doing something very wrong with include files, but I just can't see what. Basically, I have an interface class, StackDisplay, from which I want to derive CascadeDisplay in another file: #if !defined __BASE_STACK_DISPLAY_H__ #define __BASE_STACK_DISPAY_H__ #include <boost\shared_ptr.hpp> #include "CascadeDisplay.h" namespace Sol { class StackDisplay { public: virtual ~StackDisplay(); static boost::shared_ptr<StackDisplay> make_cascade_display(boost::shared_ptr<int> csptr) { return boost::shared_ptr<StackDisplay>(new CascadeDisplay(csptr)); } }; } #endif and then in CascadeDisplay.h: #if !defined __CASCADE_DISPLAY_H__ #define __CASCADE_DISPAY_H__ #include "StackDisplay.h" #include <boost\shared_ptr.hpp> namespace Sol { class CascadeDisplay: public StackDisplay { public: CascadeDisplay(boost::shared_ptr<int> csptr){}; }; } #endif So what's up with that?

    Read the article

  • How can I make this function act like an l-value?

    - by BeeBand
    Why can't I use the function ColPeekHeight() as an l-value? class View { public: int ColPeekHeight(){ return _colPeekFaceUpHeight; } void ColPeekHeight( int i ) { _colPeekFaceUpHeight = i; } private: int _colPeekFaceUpHeight; }; ... { if( v.ColPeekHeight() > 0.04*_heightTable ) v.ColPeekHeight()-=peek; } The compiler complains at v.ColPeekHeight()-=peek. How can I make ColPeekHeight() an l-value?

    Read the article

  • Const_cast on a this pointer - would I get told off by other C++ coders for doing this?

    - by BeeBand
    I have a class Game e.g. class Game { public: InitObjects(); ... }; And I have another class Grid, that needs to be initialised with a non-const reference to that Game object. ( A Grid object needs to call functions that can update a Game object ). class Grid { public: Grid(Game & g): game(g){} ... private: Game & game; ... }; The Game object is responsible for initialising the Grid. I did this: void Game::InitObjects() { grid = new Grid(*(const_cast<Game*>(this)) ); } grid is not a member of a Game - it's a global ( argh - i know... I don't mind making it a member, but I have the same problem right? ). Can some seasoned C++ folk tell me if this odd looking const_cast is acceptable?

    Read the article

1