Search Results

Search found 48 results on 2 pages for 'ereon'.

Page 1/2 | 1 2  | Next Page >

  • Triggering an action when a specific volume is connected

    - by ereOn
    I have a USB key that contains my keepass2 password database and I'd like to perform some actions when it is plugged into my computer, namely: Auto-mount it to some specific location When the mounting is done properly, launching keepass2 on the password database file Simple tasks I guess, but I can't find how to do that. I'm using Ubuntu 12.10, and it auto-mounts the device as a "media usb-key" and tries to open the images on it (even though there are none). What is the best way to do that and to disable the ubuntu auto-mounting (so it doesn't conflict) ?

    Read the article

  • Am I an idealist?

    - by ereOn
    This is not only a question, this is also a call for help. Since I started my career as a programmer, I always tried to learn from my mistakes. I worked hard to learn best-practices and while I don't consider myself a C++ expert, I still believe I'm not a beginner either. I was recently hired into a company for C++ development. There I was told that my way to work was "against the rules" and that I would have to change my mind. Here are the topics I disagree with my hierarchy (their words): "You should not use separate header files for your different classes. One big header file is both easier to read and faster to compile." "Trying to use different headers is counter-productive : use the same super-set of headers everywhere, and enforce the use #pragma hdrstop to hasten compilation" "You may not use Boost or any other library that uses nested directories to organize its files. Our build-machine doesn't work with nested directories. Moreover, you don't need Boost to create great software." One might think I'm somehow exaggerated things, but the sad truth is that I didn't. That's their actual words. I believe that having separate files enhance maintainability and code-correctness and can fasten compilation time by the use of the proper includes. Have you been in a similar situation? What should I do? I feel like it's actually impossible for me to work that way and day after day, my frustration grows.

    Read the article

  • How to suggest changes as a recently-hired employee ?

    - by ereOn
    Hi, I was recently hired in a big company (thousands of people, to give an idea of the size). They said they hired me because of my rigor and because I was, despite my youngness (i'm 25), experienced as a C/C++ programer. Now that I'm in, I can see that the whole system is old and often uses obsolete technologies. There is no naming convention (files, functions, variables, ...), they don't use Version Control, don't use exceptions or polymorphism and it seems like almost everybody lost his passion (some of them are only 30 years old). I'd like to suggest somes changes but i don't want to be "the new guy that wants to change everything just because he doesn't want to fit in". I tried to "fit in", but actually, It takes me one week to do what I would do in one afternoon, just because of the poor tools we're forced to use. A lot my collegues never look at the new "things" and techniques that people use nowadays. It's like they just given up. The situation is really frustrating. Have you ever been in a similar situation and, if so, what advices would you give me ? Is there a subtle way of changing things without becoming the black sheep here ? Or should I just give up my passion and energy as well ? Thank you. Updates Just in case (if anyone cares): following your precious advices I was able to suggest changes and am now in charge of the team that must create and deploy Subversion :D Thanks to all of you !

    Read the article

  • Is `catch(...) { throw; }` a bad practice?

    - by ereOn
    While I agree that catching ... without rethrowing is indeed wrong, I however believe that using constructs like this: try { // Stuff } catch (...) { // Some cleanup throw; } Is acceptable in cases where RAII is not applicable. (Please, don't ask... not everybody in my company likes object-oriented programming and RAII is often seen as "useless school stuff"...) My coworkers says that you should always know what exceptions are to be thrown and that you can always use constructs like: try { // Stuff } catch (exception_type1&) { // Some cleanup throw; } catch (exception_type2&) { // Some cleanup throw; } catch (exception_type3&) { // Some cleanup throw; } Is there a well admited good practice regarding these situations?

    Read the article

  • Is there a free-embedded SSH solution ?

    - by ereOn
    Hi, I'm working for an important company which has some severe network policies. I'd like to connect from my work, to my home linux server (mainly because it allows me to monitor my home-automated installation, but that's off-topic) but of course, any ssh connection (tcp port 22) to an external site is blocked. While I understand why this is done (to avoid ssh tunnels I guess), I really need to have some access to my box. (Well, "need" might be exagerated, but that would be nice ;) Do you know any web-based solution that I could install on my home linux server that would give me some pseudo-terminal (served using https) embedded in a web page ? I'm not necessarily looking for something graphical: a simple web-embedded ssh console would do the trick. Or do you guys see any other solution that wouldn't compromise network security ? Thank you very much for your solutions/advices.

    Read the article

  • Is there an easy way to read blu-rays on Windows?

    - by ereOn
    Some time ago, I bought my parents a computer dedicated to medias (mostly photographs and movies trough DLNA). My father asked me if he could read blu-ray on it, so I bought a blu-ray reader but I can't find a software to do the playback. I installed PowerDVD (a free version we got with a Blu-Ray) but it seems it now requires a (non-free) upgrade. Even if it were free, I hardly see my parent do the upgrade by themselves as they barely understand how computers work. I thought I would find a free software (something like VLC, but for blu-rays) but so far had no luck. Do you guys have a software to suggest that would solve my issues ? It should run on Windows Vista, shouldn't require an update every monday, or at least a free one. Thank you very much.

    Read the article

  • Is there anything to open .docx documents on Linux (Ubuntu) ?

    - by ereOn
    Hi, My mother has some serious issues using Windows (viruses, spywares, and so on) and I seriously think about setting up Ubuntu as a replacement. (That would ease my "job" as well) The only concern I have is, is there anything to edit .docx (or .xlsx, .pptx, ...) documents on Linux ? Last time I tried OpenOffice (was 3 years ago), it was only able to open "old" MS Office documents (.doc, .xls, ...). Thank you very much for your answers !

    Read the article

  • Is there an easy way to read Blu-ray discs on Windows?

    - by ereOn
    Some time ago, I bought my parents a computer dedicated to media (mostly photographs and movies through DLNA). My father asked me if he could read Blu-ray discs on it, so I bought a Blu-ray reader, but I can't find a software to do the playback. I installed PowerDVD (a free version we got with a Blu-ray disc), but it seems it now requires a (non-free) upgrade. Even if it were free, I hardly see my parents do the upgrade by themselves as they barely understand how computers work. I thought I would find a free software (something like VLC, but for Blu-ray discs), but so far I had no luck. Is there software that would solve my issues? It should run on Windows Vista, shouldn't require an update every monday, or at least a free one.

    Read the article

  • Removing a malware that sets up as a system driver

    - by ereOn
    Hello, I recently tried to fix up my mother's computer which has some serious malwares. One of them apparently registered itself as system driver (tjbijkoq.sys if that can help) and after running a malware suppression tool, the computer won't boot anymore, complaining about a "critical driver that is missing". I think deleting the matching entry in the registry would just solve the problem, but obviously I can't boot up the computer (even in safe mode) to fix it. Do you guys have any experience with such an issue and how to solve this ? Thank you very much. The operating system is Windows Vista 32 bits Professional

    Read the article

  • Multiple sendto() using UDP socket

    - by ereOn
    Hi, I have a network software which uses UDP to communicate with other instances of the same program. For different reasons, I must use UDP here. I recently had problems sending huge ammounts of data over UDP and had to implement a fragmentation system to split my messages into small data chunks. So far, it worked well but I now encounter an issue when I have to send a lot of data chunks. I have the following algorithm: Split message into small data chunks (around 1500 bytes) Iterate over the data chunks list and for each, send it using sendto() However, when I send a lot of data chunks, the receiver only gets the first 6 messages. Sometimes it misses the sixth and receives the seventh. It depends. Anyway, sendto() always indicates success. This always happen when I test my software over a loopback interface (127.0.0.1) but never over my LAN network. If I add something like std::cout << "test" << std::endl; between the sendto() then every frame is received. I am aware that UDP allows packet loss and that my frames might be loss for a lot of reasons and I suppose it has to do with the rate I am sending the data chunks at. What would be the right approach here ? Implementing some acknowledgement mechanism (just like TCP) seems overkill. Adding some arbitrary waiting time between the sendto() is ugly and will probably decrease performance. Increasing (if possible) the receiver UDP internal buffer ? I don't even know if this is possible. Something else ? I really need your advices here. Thank very much.

    Read the article

  • Can compiler optimization introduce bugs ?

    - by ereOn
    Hi, Today I had a discussion with a friend of mine and we debated for a couple of hours about "compiler optimization". I defended the point that sometimes, a compiler optimization might introduce bugs or at least, undesired behavior. My friend totally disagreed, saying that "compiler are built by smart people and do smart things" and thus, can never go wrong. He didn't convinced my at all, but I have to admit I lack of real-life examples to strengthen my point. Who is right here ? If I am, do you have any real-life example where a compiler optimization produced a bug in the resulting software ? If I'm mistaking, should I stop programming and learn fishing instead ? Thank you !

    Read the article

  • Understanding how rpmbuild works

    - by ereOn
    Hi, For my work, I have to create a documentation on "How-to create a RPM package on Red Hat 5". I'm used to Debian and it's derivative (Ubuntu, and so on) and thus to Debian packages (aka. .deb files). It seems that the RPM logic is quite different from what I know already and I am having some issues understanding the "RPM logic". From what I read, it seems that ones need to be root to create a RPM package. While I understand why root could be required to install a package, I still don't understand why elevated privileges should be needed to just create one. If I try to create a RPM package as a user, changing the buildroot it fails on the %installstep because I don't have permission to write files into /usr/bin. Fair enough but... why does he want to copy my files into /usr/bin at this step ?! I just want to create the package, not install it ! I'm sure I'm missing something here. Is there anyone who could give me at least a basic understanding of how rpmbuild works and why ? Thank you very much !

    Read the article

  • Disable debug output in libxml2 and xmlsec

    - by ereOn
    Hi, In my software, I use libxml2 and xmlsec to manipulate (obviously) XML data structures. I mainly use XSD schema validation and so far, it works well. When the data structure input by the client doesn't match the XSD schema, libxml2 (or xmlsec) output some debug strings to the console. Here is an example: Entity: line 1: parser error : Start tag expected, '<' not found DUMMY<?xml ^ While those strings are useful for debugging purposes, I don't want them to appear and polute the console output in the released software. So far, I couldn't find an official way of doing this. Do you know how to suppress the debug output or (even better) to redirect it to a custom function ? Many thanks.

    Read the article

  • Loading a RSA private key from memory using libxmlsec

    - by ereOn
    Hello, I'm currently using libxmlsec into my C++ software and I try to load a RSA private key from memory. To do this, I searched trough the API and found this function. It takes binary data, a size, a format string and several PEM-callback related parameters. When I call the function, it just stucks, uses 100% of the CPU time and never returns. Quite annoying, because I have no way of finding out what is wrong. Here is my code: d_xmlsec_dsig_context->signKey = xmlSecCryptoAppKeyLoadMemory( reinterpret_cast<const xmlSecByte*>(data), static_cast<xmlSecSize>(datalen), xmlSecKeyDataFormatBinary, NULL, NULL, NULL ); data is a const char* pointing to the raw bytes of my RSA key (using i2d_RSAPrivateKey(), from OpenSSL) and datalen the size of data. My test private key doesn't have a passphrase so I decided not to use the callbacks for the time being. Has someone already done something similar ? Do you guys see anything that I could change/test to get forward on this problem ? I just discovered the library on yesterday, so I might miss something obvious here; I just can't see it. Thank you very much for your help.

    Read the article

  • How to suggest changes as a recently-hired employee ?

    - by ereOn
    Hi, I was recently hired in a big company (thousands of people, to give an idea of the size). They said they hired me because of my rigor and because I was, despite my youngness (i'm 25), experienced as a C/C++ programer. Now that I'm in, I can see that the whole system is old and often uses obsolete technologies. There is no naming convention (files, functions, variables, ...), they don't use Version Control, don't use exceptions or polymorphism and it seems like almost everybody lost his passion (some of them are only 30 years old). I'd like to suggest somes changes but i don't want to be "the new guy that wants to change everything just because he doesn't want to fit in". I tried to "fit in", but actually, It takes me one week to do what I would do in one afternoon, just because of the poor tools we're forced to use. A lot my collegues never look at the new "things" and techniques that people use nowadays. It's like they just given up. The situation is really frustrating. Have you ever been in a similar situation and, if so, what advices would you give me ? Is there a subtle way of changing things without becoming the black sheep here ? Or should I just give up my passion and energy as well ? Thank you.

    Read the article

  • Qt not displaying PNG images on Linux

    - by ereOn
    Hi, I have a software written using Qt which is meant to work on both Windows and Linux. I use PNG images as icons for my QActions, embedded in a resource. I have the following tree directory: / resources/ icons.qrc image.png Here is the content of icons.qrc: <RCC> <qresource prefix="/resources" lang="fr"> <file alias="image.png">image.png</file> </qresource> </RCC> I declare my QIcon like that: QIcon(":/resources/image.png") Under Windows, it works well but on Linux (I only tried on Ubuntu 10.4 so far), the images aren't displayed. Is there anything special I have to do for this to work ? Is this a configuration problem ? Thank you.

    Read the article

  • boost::dynamic_pointer_cast with const pointer not working ?

    - by ereOn
    Hi, Let's say I have two classes, A and B, where B is a child class of A. I also have the following function: void foo(boost::shared_ptr<const A> a) { boost::shared_ptr<const B> b = boost::dynamic_pointer_cast<const B>(a); // Error ! } Compilation with gcc gives me the following errors: C:\Boost\include/boost/smart_ptr/shared_ptr.hpp: In constructor 'boost::shared_ptr< <template-parameter-1-1> >::shared_ptr(const boost::shared_ptr<Y>&, boost::detail::dynamic_cast_tag) [with Y = const A, T = const B]': C:\Boost\include/boost/smart_ptr/shared_ptr.hpp:522: instantiated from 'boost::shared_ptr<X> boost::dynamic_pointer_cast(const boost::shared_ptr<U>&) [with T = const B, U = const A]' src\a.cpp:10: instantiated from here C:\Boost\include/boost/smart_ptr/shared_ptr.hpp:259: error: cannot dynamic_cast 'r->boost::shared_ptr<const A>::px' (of type 'const class A* const') to type 'const class B*' (source type is not polymorphic) What could possibly be wrong ? Thank you.

    Read the article

  • Building both devel and normal version of a RPM package

    - by ereOn
    Hi, I have a library from which I'd like to create two RPM packages. While I found several links on how to create a basic RPM package, I can't find how to create a devel package (see this question if you wonder what a devel package is). What do I have to do to generate both devel and non-devel versions of my RPM package ? Thanks.

    Read the article

  • Check whether a string is a valid filename with Qt

    - by ereOn
    Hi, Is there a way with Qt 4.6 to check if a given QString is a valid filename (or directory name) on the current operating system ? I want to check for the name to be valid, not for the file to exist. Examples: // Some valid names test under_score .dotted-name // Some specific names colon:name // valid under UNIX OSes, but not on Windows what? // valid under UNIX OSes, but still not on Windows How would I achieve this ? Is there some Qt built-in function ? I'd like to avoid creating an empty file, but if there is no other reliable way, I would still like to see how to do it in a "clean" way. Many thanks.

    Read the article

  • Is private members hacking a defined behaviour ?

    - by ereOn
    Hi, Lets say I have the following class: class BritneySpears { public: int getValue() { return m_value; }; private: int m_value; }; Which is an external library (that I can't change). I obviously can't change the value of m_value, only read it. Even subclassing BritneySpears won't work. What if I define the following class: class AshtonKutcher { public: int getValue() { return m_value; }; public: int m_value; }; And then do: BritneySpears b; // Here comes the ugly hack AshtonKutcher* a = reinterpret_cast<AshtonKutcher*>(&b); a->m_value = 17; // Print out the value std::cout << b.getValue() << std::endl; I know this is a bad practice. But just for curiosity: is this guaranted to work ? Is it a defined behaviour ? Bonus question: Have you ever had to use such an ugly hack ? Thanks !

    Read the article

  • Immutable classes in C++

    - by ereOn
    Hi, In one of my projects, I have some classes that represent entities that cannot change once created, aka. immutable classes. Example : A class RSAKey that represent a RSA key which only has const methods. There is no point changing the existing instance: if you need another one, you just create one. My objects sometimes are heavy and I enforced the use of smart pointers to avoid copy. So far, I have the following pattern for my classes: class RSAKey : public boost::noncopyable, public boost::enable_shared_from_this<RSAKey> { public: /** * \brief Some factory. * \param member A member value. * \return An instance. */ static boost::shared_ptr<const RSAKey> createFromMember(int member); /** * \brief Get a member. * \return The member. */ int getMember() const; private: /** * \brief Constructor. * \param member A member. */ RSAKey(int member); /** * \brief Member. */ const int m_member; }; So you can only get a pointer (well, a smart pointer) to a const RSAKey. To me, it makes sense, because having a non-const reference to the instance is useless (it only has const methods). Do you guys see any issue regarding this pattern ? Are immutable classes something common in C++ or did I just created a monster ? Thank you for your advices !

    Read the article

  • Is my method for avoiding dynamic_cast<> faster than dynamic_cast<> itself ?

    - by ereOn
    Hi, I was answering a question a few minutes ago and it raised to me another one: In one of my projects, I do some network message parsing. The messages are in the form of: [1 byte message type][2 bytes payload length][x bytes payload] The format and content of the payload are determined by the message type. I have a class hierarchy, based on a common class Message. To instanciate my messages, i have a static parsing method which gives back a Message* depending on the message type byte. Something like: Message* parse(const char* frame) { // This is sample code, in real life I obviously check that the buffer // is not NULL, and the size, and so on. switch(frame[0]) { case 0x01: return new FooMessage(); case 0x02: return new BarMessage(); } // Throw an exception here because the mesage type is unknown. } I sometimes need to access the methods of the subclasses. Since my network message handling must be fast, I decived to avoid dynamic_cast<> and I added a method to the base Message class that gives back the message type. Depending on this return value, I use a static_cast<> to the right child type instead. I did this mainly because I was told once that dynamic_cast<> was slow. However, I don't know exactly what it really does and how slow it is, thus, my method might be as just as slow (or slower) but far more complicated. What do you guys think of this design ? Is it common ? Is it really faster than using dynamic_cast<> ? Any detailed explanation of what happen under the hood when one use dynamic_cast<> is welcome !

    Read the article

  • Is there any "standard" htonl-like function for 64 bits integers in C++ ?

    - by ereOn
    Hi, I'm working on an implementation of the memcache protocol which, at some points, uses 64 bits integer values. These values must be stored in "network byte order". I wish there was some uint64_t htonll(uint64_t value) function to do the change, but unfortunately, if it exist, I couldn't find it. So I have 1 or 2 questions: Is there any portable (Windows, Linux, AIX) standard function to do this ? If there is no such function, how would you implement it ? I have in mind a basic implementation but I don't know how to check the endianness at compile-time to make the code portable. So your help is more than welcome here ;) Thank you.

    Read the article

  • How to programaticaly gain root privileges ?

    - by ereOn
    I am writing a software (in C++, for Linux/Mac OSX) which runs as a non-privileged user and but needs root privileges at some point (to create a new virtual device). Running this program as root is not a option (mainly for security issues) and I need to know the identity (uid) of the "real" user. Is there a way to mimic the "sudo" command behavior (ask for user password) to temporarily gain root privileges and perform the particular task ? If so, which functions would I use ? Thank you very much for your help !

    Read the article

  • Using Qt with custom MinGW

    - by ereOn
    Hi, I don't know if this question would fit better on superuser.com, but since it's rather compiler related, I give it a try here. I have to use Qt with a specific version of gcc (4.5). I downloaded the last official Qt release for Windows (Vista, 32 bits version) and didn't install the shipped MinGW version; I just installed the Qt libraries/binaries. In a console, when I type qmake && make, make fails, complaining that 'g++' is not recognized as an internal command. If I type g++ in the same console, I however have the following output: g++: no input files So g++ is definitely recognized. For those who may ask, both the Qt binaries directory and MinGW binaries directory are in the system PATH environment variable. What could be wrong here ?

    Read the article

1 2  | Next Page >