Search Results

Search found 9082 results on 364 pages for 'c functions'.

Page 170/364 | < Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >

  • C++ Win/Linux thread syncronization Event

    - by JP
    Hello I have some code that is cross-platform by unsing #ifdef OS, I have a Queue protected by a CriticalSection on Windows, and by a pthread_mutex_t on Linux. I would like to implement a Wait(timeout) call that would block a thread until something has been enqueued. I though about using WaitForSingleObject on windows but it don't seem to support CriticalSection. Which Win32 and which Linux functions should I use to Wait and Signal for a condition to happen. Thank

    Read the article

  • why my C++ output executable is so big?

    - by Vincenzo
    I have a rather simple C++ project, which uses boost::regex library. The output I'm getting is 3.5Mb in size. As I understand I'm statically linking all boost .CPP files, including all functions/methods. Maybe it's possible somehow to instruct my linker to use only necessary elements from boost, not all of them? Thanks.

    Read the article

  • c++ template function compiles in header but not implementation

    - by flies
    I'm trying to learn templates and I've run into this confounding error. I'm declaring some functions in a header file and I want to make a separate implementation file where the functions will be defined. Here's the code that calls the header (dum.cpp): #include <iostream> #include <vector> #include <string> #include "dumper2.h" int main() { std::vector<int> v; for (int i=0; i<10; i++) { v.push_back(i); } test(); std::string s = ", "; dumpVector(v,s); } now, here's a working header file (dumper2.h): #include <iostream> #include <string> #include <vector> void test(); template <class T> void dumpVector( std::vector<T> v,std::string sep); template <class T> void dumpVector(std::vector<T> v, std::string sep) { typename std::vector<T>::iterator vi; vi = v.begin(); std::cout << *vi; vi++; for (;vi<v.end();vi++) { std::cout << sep << *vi ; } std::cout << "\n"; return; } with implentation (dumper2.cpp): #include <iostream> #include "dumper2.h" void test() { std::cout << "!olleh dlrow\n"; } the weird thing is that if I move the code that defines dumpVector from the .h to the .cpp file, I get the following error: g++ -c dumper2.cpp -Wall -Wno-deprecated g++ dum.cpp -o dum dumper2.o -Wall -Wno-deprecated /tmp/ccKD2e3G.o: In function `main': dum.cpp:(.text+0xce): undefined reference to `void dumpVector<int>(std::vector<int, std::allocator<int> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)' collect2: ld returned 1 exit status make: *** [dum] Error 1 So why does it work one way and not the other? Clearly the compiler can find test(), so why can't it find dumpVector?

    Read the article

  • using declarations in main (C++)

    - by Crystal
    Although you wouldn't want to do this, if you have a namespace COMPANY, and a class in that namespace SOMECLASS. Why is it that in the .cpp file, you might define the functions as COMPANY::SOMECLASS::someFunction() {} But in main, you don't do int main() { COMPANY::SOMECLASS::someFunction(); } but instead you declare the namespace and do something like: using COMPANY::SOMECLASS; int main() { someFunction(); }

    Read the article

  • .NET coupled with MATLAB or R?

    - by Peter
    I'm writing a program in .NET that will need to utilize the statistical and data analysis functions of R or MATLAB. I have used R but am now contemplating moving to MATLAB since it has a .Net compiler while R can only interface via COM objects. Can anyone recommend going either way? I know MATLAB is infinitely more expensive than R (since R is free) but I'm thinking that may translate to an easier development cycle?

    Read the article

  • Strongest cipher available to use with C/C++ ?

    - by George0x77
    I am just wondering if you are supposed to write a sort of really secure application with data being transmitted over insecure networks, what kind of encryption algorithm will you use it in order to make it safe ? I know several c++ libraries for encryption providing nice functions with different algorithms, but i'm not quite sure which cipher to use - AES, DES, RSA, Blowfish or maybe something more different ? Please provide your ideas and suggestions. Thank you.

    Read the article

  • xdebug profiler output strange results

    - by nic28
    I'm using xdebug to profile some PHP code on Windows and using WinCacheGrind/Webgrind to analyse the output, but I'm getting some strange results. Specifically, the total cumulative time for a single method is greater than 100%! How is it possible that more time is spent executing this function's code and all the functions that it calls than the total time it took to execute the whole script? What am I missing here?

    Read the article

  • recommending gcc to inline the function

    - by thetna
    I don't know how feasible it is and how sensible is this question here. Is there any changes that we can make in makefile to recommend GCC inline all the function although the functions are not inlined during the declaration or nowhere in the source file.

    Read the article

  • [Python] How to create a named temporary file in memory?

    - by conradlee
    I would like to use Python's tempfile module to create a temporary file that I will use for communication between processes (use of pipes is awkward). The documentation I've linked to above shows two functions that almost do what I want: tempfile.NamedTemporaryFile # For creating named tempfiles tempfile.SpooledTemporaryFile # For creating tempfiles in memory but actually I want a tempfile that is both named AND in memory. Any ideas?

    Read the article

  • Production ready alternative to Microsoft Doloto (Javascript minifier/prefetcher)?

    - by usr
    As you surely know Microsoft Doloto is tool which profiles you javascript code as it actually runs on the page and splits it in to two files: one file will be statically included in the footer of the page which contains stubs for all functions and loads the actual implementations (in file 2) in the background (under the assumption that only very litte javascript is needed on page load so you can defer downloading the rest). I found Doloto not to be production ready, it meanwhile has been canceled afaik. Is there a working alternative?

    Read the article

  • Can we write an EOF character ourselves?

    - by Apoorv
    Most of the languages like C++ when writing into a file, put an EOF character even if we miss to write statements like : filestream.close However is there any way, we can put the EOF character according to our requirement, in C++, for an instance. Or any other method we may use apart from using the functions provided in C++. If you need to ask more of information then kindly do give a comment. Thanks in advance.

    Read the article

  • lua - how to call function from above it in code (prior to it being defined)?

    - by Greg
    what is the syntax (i.e. code example) in Lua so you can call a function prior to it being defined? i.e. how do you kind of create the function, but then add it's implementation further down in code. So roughly like this: define function name (doX) here somehow (i.e. subject of this question) call doX here (further down in the code) doX implemention here (i.e. all functions down at the bottom of the file)

    Read the article

  • penalty for "inlined" classes

    - by 2di
    Hi All Visual studio allow you to create "inlined" classes (if I am not mistaken with the name). So class header and implementation all in one file. H. file contain definitions and declarations of the class and functions, there is no .cpp file at all. So I was wondering if there is any penalty for doing it that way? any disadvantages ? Thanks a lot

    Read the article

  • Using macro to check null values

    - by poliron
    My C code contains many functions with pointers to different structs as parameters which shouldn't be NULL pointers. To make my code more readable, I decided to replace this code: if(arg1==NULL || arg2==NULL || arg3==NULL...) { return SOME_ERROR; } With that macro: NULL_CHECK(arg1,arg2,...) How should I write it, if the number of args is unknown and they can point to different structs?(I work in C99)

    Read the article

  • How classes are secure than structures ?

    - by Asad Hanif
    Structure's member are public by default ans class's members are private by default. We can access private data members through a proper channel (using member function). If we have access to member functions we can read/write data in private data member, so how it is secure...we are accessing it and we are changing data too.....

    Read the article

  • MySQL DATE_ADD usage, 5 day interval

    - by Webnet
    I'm trying to select the order total sum ($) and invoice count over a 5 day period in a single query. I can't seem to get this to happen though. The current query I have is here... SELECT COUNT(id) as invoice_count, SUM(orderTotal) as orders_sum, UNIX_TIMESTAMP(created) as created FROM ids_invoice WHERE DATE_ADD(created, INTERVAL +1 DAY) AND userId = '.$userId.$whereSql I'm not entirely sure DATE_ADD is the right function I'm looking for I'm fairly new to mysql date functions so perhaps I just missed the function I needed when going through mysql docs.

    Read the article

  • How can I locate .NET Library property/function that return a particular type?

    - by Michael Bray
    Occasionally I will know that there is a .NET Framework function that returns a particular type of object, but I can't recall the property or function name. It would be really nice to be able to somehow scan the Framework or other DLL for functions that return a particular type of object. (For example, it would have helped when I asked this question, and I have a similar question again.) Can anyone suggest how I might do this?

    Read the article

  • jQuery getScript function with frames

    - by user210099
    Hello.. I'm a novice at Javascript/Jquery programming, so an apology if this is a simple/silly question. I am trying to use the jQuery .getScript() function to refresh part of an existing webpage. This webpage must be run on a local file system, and a large amount of the formatting is done using frames. Right now, there’s three main frames- a sidebar which displays possible “scopes” to choose from, a main frame which displays the majority of the contents of the webpage, and a footer frame. The main entry into the page is in an index.html file, which loads a sidebar.html, main.html, and footer.html file into each of the respective frames. In turn, the main.html has a number of javascript files which it loads, the main being a main.js, which contains numerous functions to format/process the contents for this main window. After loading this javascript file, main.html loads a few javascript files, which contain the data which is going to be displayed in the main frame. These files that are loaded have a fixed data structure, and are dependent on the functions that were loaded by the main.js file. Loading the webpage works fine now, but when a user tries to switch to another “scope”, the whole webpage is reloaded to make the switch. The only difference in the webpage is the content in the main.js frame, loaded in by a different set of .js files. Enough text, let’s look at some code. When the webpage loads, I tried to add a simple call to the getScript function in a .js file at the index.html level which handles switching scopes. This file, newFile, has different data definitions than the previously loaded oldFile.js which was loaded in the main.html file. $.getScript(/js/newFile.js); However this doesn’t work, since newFile.js depends on a parseData() function which is in main.js. If I open firebug up, parseData is not located in the dom tab, which I assume is related to some scoping issue with the main.html and main.js file existing in a different frame. I tried to do some targeting to the correct “frame” but I don’t think I understand jQuery enough to know what is happening. $(window.parent.frames[0]).getScript(/js/newFile.js); Any suggestions? If I were to type into firebug console “parseData” it can not find it: “ReferenceError: parseData is not defined” However, if I type in window.parent.frames[1].parseData, it can find the function. Sorry about all the rambling and poor understanding of javascript. Hopefully someone can provide some assistance! Thanks

    Read the article

  • Passing around an ElementTree

    - by PulpFiction
    Hello. In my program, I need to make use of an ElementTree object in various functions in my program. More specifically, I am doing this: tree = etree.parse('somefile.xml') I am passing this tree around in my program. I was wondering whether this is a good approach, or can I do this: Create a global tree (I come from a C++ background and I know global is bad) Create the tree again wherever required. Or is my approach ok?

    Read the article

  • symfony autocompletion in netbeans?

    - by fayer
    im using netbeans to code a web application with symfony. it seems that netbeans doesnt support symfony in auto completion. could one fix this problem. cause i want to be able to click on symfony's functions and get to the source, eg helper function and model methods and classes.

    Read the article

  • Can Visual Studio manage function prototypes for me in C++ header files?

    - by Gibybo
    In C++, the common practice is to declare functions in header files and define them in cpp files. This leads to always having two copies of every function's prototype. Then whenever I want to change a function's name/return value/parameter, I have to manually change it in both files. This seems unnecessarily tedious and there must be lots of people that share my pain, so is there a way to automate these changes between files in VS? Bonus points for vim solutions as well.

    Read the article

< Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >