Search Results

Search found 35 results on 2 pages for 'dehmann'.

Page 1/2 | 1 2  | Next Page >

  • Cannot access certain URL on my wireless

    - by dehmann
    Problem: On my wireless network at home, there is one URL that I just cannot access with my browser: http://research.microsoft.com/ I have no problems with the Internet connection otherwise. But on that address I just get The connection was reset The connection to the server was reset while the page was loading. from Firefox. I am using a DSL modem (Westell) and Linksys wireless router (using DHCP). When I use my neighbor's wireless connection I can access the microsoft site without a problem. Additional technical details: But with my connection, here is what I get from nslookup. It is weird: It first cannot find the address, but after I look up another address it can find it: $ nslookup research.microsoft.com ;; connection timed out; no servers could be reached $ nslookup google.com Non-authoritative answer: Name: google.com Address: 72.14.204.104 Name: google.com Address: 72.14.204.147 Name: google.com Address: 72.14.204.99 Name: google.com Address: 72.14.204.103 $ nslookup research.microsoft.com Non-authoritative answer: Name: research.microsoft.com Address: 131.107.65.14 But even after nslookup finds it Firefox still cannot access it. Here is what traceroute says: $ traceroute http://research.microsoft.com/ traceroute: Warning: http://research.microsoft.com/ has multiple addresses; using 8.15.7.117 traceroute to http://research.microsoft.com/ (8.15.7.117), 64 hops max, 40 byte packets 1 dslrouter.westell.com (1XX.XXX.X.X) 4.515 ms 2.760 ms 3.072 ms 2 * * * Traceroute just to the IP: $ traceroute 131.107.65.14 traceroute to 131.107.65.14 (131.107.65.14), 64 hops max, 40 byte packets 1 dslrouter.westell.com (1XX.XXX.X.X) 11.912 ms 2.684 ms 2.808 ms 2 * * * Comparison: Traceroute to google.com IP: $ traceroute 72.14.204.99 traceroute to 72.14.204.99 (72.14.204.99), 64 hops max, 40 byte packets 1 dslrouter.westell.com (1XX.XXX.X.X) 6.428 ms 6.981 ms 117.099 ms 2 * * * Any comments / help?

    Read the article

  • Streaming flash video does not work on my Mac OS X

    - by dehmann
    Flash videos do not work properly on my Mac. On this Vimeo video, for example, it shows only the beginning frame, and audio stutters like crazy, playing audio for a quarter second or so, then silence, then playing again, etc. I have Flash version 10,0,42,34 on Mac OS 10.5.8. It's a PowerBook G4 (PPC). I tried it in Firefox 3.5.5 and Safari 4.0.3. I tried reinstalling Flash, restarting the computer, and using a fresh user profile in Firefox (so that no extensions are interfering with the site), loading the video fully before playing, but nothing helps. I noticed that youtube videos work better, once loaded enough, although the picture does halt briefly once every 10 or so seconds, even when it's fully loaded.

    Read the article

  • How to check if Emacs is in GUI mode (and execute `tool-bar-mode` only then)?

    - by dehmann
    I have this line in my .emacs file: (tool-bar-mode 0) because I hate the toolbars in my GUI emacs (/Applications/Emacs.app/Contents/MacOS/Emacs). But when I start up my other, text-based emacs in the terminal (/opt/local/bin/emacs) it complains about that command: Symbol's function definition is void: tool-bar-mode How can I add an if condition so that it executes the tool-bar-mode command only when I'm in the GUI emacs? Thanks!

    Read the article

  • How to migrate part of an SVN repository?

    - by dehmann
    How do you migrate a part of an SVN repository into a new repository? To migrate the contents of a complete SVN repository into a new repository, one has to dump the old repository first: svnadmin dump /path/to/repository > repository-name.dmp and then load it into the new one using svnadmin load. But I'm not sure how to just migrate a part. Do I still have to dump the whole thing? Do I grep for the part that I want? To just dump myproject, I tried this, but it didn't work: svnadmin dump /path/to/repository/myproject Any ideas?

    Read the article

  • How to set PATH variable on Mac OS so that even non-terminal apps see it?

    - by dehmann
    I need to add a directory to my PATH variable on Mac OS. I added it in .bash_profile and .profile, and that works for the terminal. But Emacs (http://emacsformacosx.com) still does not use the new PATH variable. (I'm trying to run latex from emacs, but it's not finding the command in my /usr/local/bin, which I'm trying to add to the PATH ...) I even logged out and back in, but still no luck. Any suggestions?

    Read the article

  • How to dump only a certain part of SVN repository?

    - by dehmann
    How to you move a part of an SVN repository into a new repository? To move the contents of a complete SVN repository into a new repository, one has to dump the old repository first: svnadmin dump /path/to/repository > repository-name.dmp and then load it into the new one using svnadmin load. But I'm not sure how to just move a part. Do I still have to dump the whole thing? Do I grep for the part that I want? To just dump myproject, I tried this, but it didn't work: svnadmin dump /path/to/repository/myproject

    Read the article

  • What is the official installer for Unix packages on Mac OS?

    - by dehmann
    I'm a bit confused about the installation of standard Unix packages on Mac OS X. For example, I have /usr/bin/svn, which is SVN v.1.4.4, but FinkCommander says svn is not installed. The same holds for other packages, like emacs etc. Is that just a wrong FinkCommander setting? Currently it is set to install everything in /sw, which is not even in the PATH. So, do I just have to set it to install packages to /usr, and it will recognize the installed software? I don't want to install duplicate packages of everything, and it is quite weird that the FinkCommander seems not to be in sync with the installed software. Or is there any other installer I should be using? Is Mac Ports the recommended installer to use? (I'm using Mac OS 10.5.8.)

    Read the article

  • Cannot do sudo: "/etc/sudoers is mode 0740, should be 0440"

    - by dehmann
    I have a problem: I don't have a root password on my mac. I just have an Admin account, which can do stuff using sudo. Now, I wanted to add my normal user to the /etc/sudoers file as well. Since it did not let me write to that file (even writing using sudo), I did this: sudo chmod u+w /etc/sudoers That worked. But since then I can't do any sudo command anymore on my system. It complains that /etc/sudoers has the wrong mode: $ sudo touch /etc/sudoers sudo: /etc/sudoers is mode 0740, should be 0440 Segmentation fault It sounds like a bad joke, because now I can't even change the mode back to 0440: $ sudo chmod 0440 /etc/sudoers sudo: /etc/sudoers is mode 0740, should be 0440 Segmentation fault Is there any way to fix this situation? I need to get my sudo abilities back.

    Read the article

  • Convert shell logs (incl. escape characters) to HTML?

    - by dehmann
    Is there tool or a regexp that can convert shell escape characters to HTML code? As an example, here is a logfile from GNU screen: ^MESC[K$ ^MESC[K$ exit Executing .bashrc ESC[00;31;31mserver.xyz.com: ESC[00;34;34m~ which I would like to convert to something like this: $ exit Executing .bashrc <font color=red>server.xyz.com</font>: <font color=blue>~</font> and send as HTML e-mail to an e-mail address, to archive my work. Here is a related question, which shows how to convert it to regular text, but it would be nice to convert to HTML and not just throw the escape characters away.

    Read the article

  • How to toggle between .cpp and .hpp that are not in the same directory?

    - by dehmann
    Is there an Emacs function that toggles between .cpp and .hpp files that are not in the same directories? I know there is toggle-source.el, but it apparently does not handle the case where .cpp and .hpp are not in different directories. But my directory structure is like this: project1/src/foo.cpp project1/include/foo.hpp project2/src/bar.cpp project2/include/bar.hpp It shouldn't be hard to toggle between src/foo.cpp and include/foo.hpp but I don't speak Lisp ... :`(

    Read the article

  • Google Wave as code repository and IDE?

    - by dehmann
    Is it possible to write a Google Wave plugin that turns it into an IDE for programming? With such an extension, Google Wave would be a replacement for Eclipse etc., and it would naturally be a code repository at the same time (replacing SVN, git, etc.). Users (programmers) would be able to create code files directly in Wave and add collaborators to do pair programming etc. The whole codebase would live in a Wave folder, and an extension would do the building and compiling on the fly. How would one go about writing such an extension?

    Read the article

  • Automatically find compiler options for fastest exe on given machine?

    - by dehmann
    Is there a method to automatically find the best compiler options (on a given machine), which result in the fastest possible executable? Naturally, I use g++ -O3, but there are additional flags that may make the code run faster, e.g. -ffast-math and others, some of which are hardware-dependent. Does anyone know some code I can put in my configure.ac file (GNU autotools), so that the flags will be added to the Makefile automatically by the ./configure command? In addition to automatically determining the best flags, I would be interested in some useful compiler flags that are good to use as a default for most optimized executables.

    Read the article

  • Function that prints something to std::ostream and returns std::ostream?

    - by dehmann
    I want to write a function that outputs something to a ostream that's passed in, and return the stream, like this: std::ostream& MyPrint(int val, std::ostream* out) { *out << val; return *out; } int main(int argc, char** argv){ std::cout << "Value: " << MyPrint(12, &std::cout) << std::endl; return 0; } It would be convenient to print the value like this and embed the function call in the output operator chain, like I did in main(). It doesn't work, however, and prints this: $ ./a.out 12Value: 0x6013a8 The desired output would be this: Value: 12 How can I fix this? Do I have to define an operator<< instead? UPDATE: Clarified what the desired output would be. UPDATE2: Some people didn't understand why I would print a number like that, using a function instead of printing it directly. This is a simplified example, and in reality the function prints a complex object rather than an int.

    Read the article

  • Why does this cast to Base class in virtual function give a segmentation fault?

    - by dehmann
    I want to print out a derived class using the operator<<. When I print the derived class, I want to first print its base and then its own content. But I ran into some trouble (see segfault below): class Base { public: friend std::ostream& operator<<(std::ostream&, const Base&); virtual void Print(std::ostream& out) const { out << "BASE!"; } }; std::ostream& operator<<(std::ostream& out, const Base& b) { b.Print(out); return out; } class Derived : public Base { public: virtual void Print(std::ostream& out) const { out << "My base: "; //((const Base*)this)->Print(out); // infinite, calls this fct recursively //((Base*)this)->Print(out); // segfault (from infinite loop?) ((Base)*this).Print(out); // OK out << " ... and myself."; } }; int main(int argc, char** argv){ Derived d; std::cout << d; return 0; } Why can't I cast in one of these ways? ((const Base*)this)->Print(out); // infinite, calls this fct recursively ((Base*)this)->Print(out); // segfault (from infinite loop?)

    Read the article

  • operator<< cannot output std::endl -- Fix?

    - by dehmann
    The following code gives an error when it's supposed to output just std::endl: #include <iostream> #include <sstream> struct MyStream { std::ostream* out_; MyStream(std::ostream* out) : out_(out) {} std::ostream& operator<<(const std::string& s) { (*out_) << s; return *out_; } }; template<class OutputStream> struct Foo { OutputStream* out_; Foo(OutputStream* out) : out_(out) {} void test() { (*out_) << "OK" << std::endl; (*out_) << std::endl; // ERROR } }; int main(int argc, char** argv){ MyStream out(&std::cout); Foo<MyStream> foo(&out); foo.test(); return EXIT_SUCCESS; } The error is: stream1.cpp:19: error: no match for 'operator<<' in '*((Foo<MyStream>*)this)->Foo<MyStream>::out_ << std::endl' stream1.cpp:7: note: candidates are: std::ostream& MyStream::operator<<(const std::string&) So it can output a string (see line above the error), but not just the std::endl, presumably because std::endl is not a string, but the operator<< definition asks for a string. Templating the operator<< didn't help: template<class T> std::ostream& operator<<(const T& s) { ... } How can I make the code work? Thanks!

    Read the article

  • How to have a policy class implement a virtual function?

    - by dehmann
    I'm trying to design a policy-based class, where a certain interface is implemented by the policy itself, so the class derives from the policy, which itself is a template (I got this kind of thinking from Alexandrescu's book): #include <iostream> #include <vector> class TestInterface { public: virtual void test() = 0; }; class TestImpl1 { public: void test() {std::cerr << "Impl1" << std::endl;} }; template<class TestPolicy> class Foo : public TestInterface, TestPolicy { }; Then, in the main() function, I call test() on (potentially) various different objects that all implement the same interface: int main() { std::vector<TestInterface*> foos; foos.push_back(new Foo<TestImpl1>()); foos[0]->test(); delete foos[0]; return 0; } It doesn't compile, though, because the following virtual functions are pure within ‘Foo<TestImpl1>’: virtual void TestInterface::test() I thought TestInterface::test() is implemented because we derive from TestImpl1?

    Read the article

  • What is the most efficient Java Collections library?

    - by dehmann
    What is the most efficient Java Collections library? A few years ago, I did a lot of Java and had the impression back then that trove is the best (most efficient) Java Collections implementation. But when I read the answers to the question "Most useful free Java libraries?" I noticed that trove is hardly mentioned. So which Java Collections library is best now? UPDATE: To clarify, I mostly want to know what library to use when I have to store millions of entries in a hash table etc. (need a small runtime and memory footprint).

    Read the article

  • How to shrink-to-fit an std::vector in a memory-efficient way?

    - by dehmann
    I would like to 'shrink-to-fit' an std::vector, to reduce its capacity to its exact size, so that additional memory is freed. The standard trick seems to be the one described here: template< typename T, class Allocator > void shrink_capacity(std::vector<T,Allocator>& v) { std::vector<T,Allocator>(v.begin(),v.end()).swap(v); } The whole point of shrink-to-fit is to save memory, but doesn't this method first create a deep copy and then swaps the instances? So at some point -- when the copy is constructed -- the memory usage is doubled? If that is the case, is there a more memory-friendly method of shrink-to-fit? (In my case the vector is really big and I cannot afford to have both the original plus a copy of it in memory at any time.)

    Read the article

  • Policy-based template design: How to access certain policies of the class?

    - by dehmann
    I have a class that uses several policies that are templated. It is called Dish in the following example. I store many of these Dishes in a vector (using a pointer to simple base class), but then I'd like to extract and use them. But I don't know their exact types. Here is the code; it's a bit long, but really simple: #include <iostream> #include <vector> struct DishBase { int id; DishBase(int i) : id(i) {} }; std::ostream& operator<<(std::ostream& out, const DishBase& d) { out << d.id; return out; } // Policy-based class: template<class Appetizer, class Main, class Dessert> class Dish : public DishBase { Appetizer appetizer_; Main main_; Dessert dessert_; public: Dish(int id) : DishBase(id) {} const Appetizer& get_appetizer() { return appetizer_; } const Main& get_main() { return main_; } const Dessert& get_dessert() { return dessert_; } }; struct Storage { typedef DishBase* value_type; typedef std::vector<value_type> Container; typedef Container::const_iterator const_iterator; Container container; Storage() { container.push_back(new Dish<int,double,float>(0)); container.push_back(new Dish<double,int,double>(1)); container.push_back(new Dish<int,int,int>(2)); } ~Storage() { // delete objects } const_iterator begin() { return container.begin(); } const_iterator end() { return container.end(); } }; int main() { Storage s; for(Storage::const_iterator it = s.begin(); it != s.end(); ++it){ std::cout << **it << std::endl; std::cout << "Dessert: " << *it->get_dessert() << std::endl; // ?? } return 0; } The tricky part is here, in the main() function: std::cout << "Dessert: " << *it->get_dessert() << std::endl; // ?? How can I access the dessert? I don't even know the Dessert type (it is templated), let alone the complete type of the object that I'm getting from the storage. This is just a toy example, but I think my code reduces to this. I'd just like to pass those Dish classes around, and different parts of the code will access different parts of it (in the example: its appetizer, main dish, or dessert).

    Read the article

  • How to std::find using a Compare object?

    - by dehmann
    I am confused about the interface of std::find. Why doesn't it take a Compare object that tells it how to compare two objects? If I could pass a Compare object I could make the following code work, where I would like to compare by value, instead of just comparing the pointer values directly: typedef std::vector<std::string*> Vec; Vec vec; std::string* s1 = new std::string("foo"); std::string* s2 = new std::string("foo"); vec.push_back(s1); Vec::const_iterator found = std::find(vec.begin(), vec.end(), s2); // not found, obviously, because I can't tell it to compare by value delete s1; delete s2; Is the following the recommended way to do it? template<class T> struct MyEqualsByVal { const T& x_; MyEqualsByVal(const T& x) : x_(x) {} bool operator()(const T& y) const { return *x_ == *y; } }; // ... vec.push_back(s1); Vec::const_iterator found = std::find_if(vec.begin(), vec.end(), MyEqualsByVal<std::string*>(s2)); // OK, will find "foo"

    Read the article

  • Is assert evil?

    - by dehmann
    The Go language creators write: Go doesn't provide assertions. (...) Programmers use them as a crutch to avoid thinking about proper error handling and reporting. What is your opinion about this?

    Read the article

  • Is this call to a function object inlined?

    - by dehmann
    In the following code, Foo::add calls a function via a function object: struct Plus { inline int operator()(int x, int y) const { return x + y; } }; template<class Fct> struct Foo { Fct fct; Foo(Fct f) : fct(f) {} inline int add(int x, int y) { return fct(x,y); // same efficiency adding directly? } }; Is this the same efficiency as calling x+y directly in Foo::add? In other words, does the compiler typically directly replace fct(x,y) with the actual call, inlining the code, when compiling with optimizations enabled?

    Read the article

  • Is it good practice to use std::size_t all over the place?

    - by dehmann
    I have a lot of constants in my code that are unsigned numbers, e.g. counters, frequency cutoffs, lengths, etc. I started using std::size_t for all of these, instead of int or unsigned int. Is that the right thing to do? I started it because the STL containers use it for their sizes, it's used for string position, etc.

    Read the article

1 2  | Next Page >