Search Results

Search found 9134 results on 366 pages for 'variadic functions'.

Page 76/366 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • file_get_contents not working with non english filenames in DRUPAL

    - by Novarg
    Hello. I have a problem. file_get_contents and other file functions (like file, fopen, glob etc) not working when i try to get file with non english symbols. I getting error that file not exist. It is going when i using any of that functions from my simple drupal module. But same time when i try to use file_get_contents outside drupal's code (just created separated php file) this function work as it should. Can you advice something?? What drupal doing so i can't use file functions on file with non english name from my module? Thanks.

    Read the article

  • Python: Using `copyreg` to define reducers for types that already have reducers

    - by cool-RR
    (Keep in mind I'm working in Python 3, so a solution needs to work in Python 3.) I would like to use the copyreg module to teach Python how to pickle functions. When I tried to do it, the _Pickler object would still try to pickle functions using the save_global function. (Which doesn't work for unbound methods, and that's the motivation for doing this.) It seems like _Pickler first tries to look in its own dispatch for the type of the object that you want to pickle before looking in copyreg.dispatch_table. I'm not sure if this is intentional. Is there any way for me to tell Python to pickle functions with the reducer that I provide?

    Read the article

  • PHP: include inside include

    - by Karem
    In dbc.php I have where the connection to the mysql db gets made, and all my functions is there. dbc.php is included on all my files. Now all functions are in dbc.php and i would like to sort out alittle. I was thinking about putting all form_*() functions to form_api.php, and then include it in dbc.php. But will this work? Can i just include inside a file i included? Or should i use require/include_once ? help me out thank you

    Read the article

  • Haskell: Problems with overloading: Interpreter can´t tell which + to use

    - by Ben
    Hi, I want to make functions Double - Double an instance of the Num typeclass. I want to define the sum of two functions as sum of their images. So I wrote instance Num Function where f + g = (\ x - (f x) + (g x)) Here the compiler complains he can´t tell whether I´m using Prelude.+ or Module.+ in the lambda expression. So I imported Prelude qualified as P and wrote instance Num Function where f + g = (\ x - (f x) P.+ (g x)) This compiles just fine, but when I try to add two functions in GHCi the interpreter complains again he can´t tell whether I´m using Prelude.+ or Module.+. Is there any way I can solve this problem?

    Read the article

  • Passing around objects to network packet handlers ?

    - by xeross
    Hey, I've been writing a networking server for a while now in C++ and have come to the stage to start looking for a way to properly and easily handle all packets. I am so far that I can figure out what kind of packet it is, but now I need to figure out how to get the needed data to the handler functions. I had the following in mind: Have a map of function pointers with the opcode as key and the function pointer as value Have all these functions have 2 arguments, packet and ObjectAccessor ObjectAccessor class contains various functions to fetch various items such as users and alike Perhaps pass the user's guid too so we can fetch it from the objectaccessor I'd like to know the various implementations others have come up with, so please comment on this idea and reply with your own implementations. Thanks, Xeross

    Read the article

  • Unresolved External Symbol

    - by TomO
    I am working on wrapping a large number of .h and .lib files from native C++ to Managed C++ for eventual use as a referenced .dll in C#. I have the .lib files linked in and everything has been going smoothly so far. Upon wrapping the latest .h file, I hit a snag when 2 functions came back with the link error: error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function "public: void __thiscall Field::setCharacter(unsigned char,int)" (?setCharacter@Field@@QAEXEH@Z) myutils.lib I have referenced "myutils.lib" in the linker options, so that shouldn't be the issue. What's strange is that I have about 20 functions in this particular .h file and all of the rest are linking just fine except for 3 functions. Any ideas?

    Read the article

  • Freeglut ( OpenGL ) in C

    - by user1832149
    I would like to ask for you a little help in my homework. I'm learning at an university of Debrecen, and I would like to be a programmer, but I'm stuck with this homework. It's a OpenGL project in C. (freeglut) The next task is about: Window to viewport transformation. Draw graphs of functions, as shown below. The individual views (viewport) defines four different rectangles. Functions look like this picture: one window in 4 piece, and one pice of one function. The functions, respectively: f(x)=x2 g(x)=x3 h(x)=sin(x) i(x)=cos(x) Heres a pic what I need to make: How would I approach such a task?

    Read the article

  • Comments for Function in Emacs

    - by Ryan
    I'm looking for a way to add comments for my functions in Emacs. Of course doxymacs is a nice candidate. But I prefer another way works without the necessary libs. Can anyone recommend some others ways for adding smart comments for functions in Emacs? Thanks. Edit: Now I found this: http://nschum.de/src/emacs/doc-mode/, but it seems that it does not work well after I require it into my .emacs and add hook for js-mode. Doesn't it support js functions ?

    Read the article

  • Securely using exec with PHP to run ffmpeg

    - by Venkat D.
    I would like to run ffmpeg from PHP for video encoding purposes. I was thinking of using the exec or passthru commands. However, I have been warned that enabling these functions is a security risk. In the words of my support staff: The directive 'disable_functions' is used to disable any functions that allow the execution of system commands. This is for more security of the server. These PHP functions can be used to crack the server if not used properly. I'm guessing that if exec is enabled, then someone could (possibly) execute an arbitrary unix command. Does anyone know of a secure way to run ffmpeg from PHP? By the way, I'm on a dedicated server. Thanks ahead of time!

    Read the article

  • C++ allocate objects on heap of base class with protected constructors via inheritance

    - by KRao
    I have a class with protected constructor: class B { protected: B(){}; }; Now I derive from it and define two static functions and I manage to actually create objects of the class B, but not on the heap: class A : public B { public: static B createOnStack() {return B();} //static B* createOnHeap() {return new B;} //Compile time Error on VS2010 }; B b = A::createOnStack(); //This works on VS2010! The question is: 1) Is VS2010 wrong in allowing the first case? 2) Is it possible to create objects of B without modifying B in any way (no friendship and no extra functions). I am asking, because it is possible to make something similar when dealing with instances of B and its member functions, see: http://accu.org/index.php/journals/296 Thank you in advance for any suggestion! Kind regards

    Read the article

  • How to order my objects in a C++ class correctly

    - by Julen
    Hello, I have been coding regurlarly in C++ in the past months. I am getting used to it step by step... but there are things that confuse me about formatting. I know there is a lot of legacy from C that I supousee mixes with C++. This time I have doubts about how to order properly my members and functions within in a class. Also considering their access modifiers. How is the convention in this? Until know I am doing everything "public" and writing first constructor of class, then destructor, next members and finally functions. It this correct? What happens when introducing "private" and "protected" access modifiers or "virtual" functions? From the documents I have look in the Internet there is different ways of doing things. But my questions aims to get the knowledge from a community that develops in C++ that I want to blend into. ;-) Thanks a lot!!!

    Read the article

  • Adobe After Efects Plugin With Cocoa (Overriding malloc)

    - by mustISignUp
    Messing about a bit, i have a working Adobe After Effects plugin with a bit of Obj-c / Cocoa in it (NSArray and custom objects - not ui stuff). The SDK guide states:- Always use After Effects memory allocation functions. In low-memory conditions (such as during RAM preview), it’s very important that plug-ins not compete with After Effects for OS memory, and deal gracefully with out-of-memory conditions. Failing to use our functions can cause lock-ups, crashes, and tech support calls. Don’t do that. If you’re wrapping existing C++ code, overloading new and delete to use our functions will save substantial reimplementation. On Windows, derive all classes from a common base class which implements new and delete. so my question.. is something compatible with the above statement possible in Obj-c?

    Read the article

  • SWIG interface file questions

    - by morpheous
    I am writing a C/C++ extension module for other languages and I am using SWIG to generate the bindings. I have two questions Can I include more than 1 header file in the declaration part of the interface file e.g.: /* Declarations exposed to wrapper: */ > %{ > #define SWIG_FILE_WITH_INIT > #include "a.h" > #include "b.h" > #include "c.h" %} In all of the examples I have seen so far, after the header include declaration (as shown above), the functions declared in the header are then declared again in the interface file. Is this really necessary, as it means there are two copies of the function declarations that need to be maintained. Note: I can appreciate that some functions/methods declaration may need to be 'decorated' with the 'newobject' declaration so these obviously need to be in the interface file, to avoid memory leaks - however, I would have though that it would be sufficient to include the headers and then ONLY the declarations of the functions/methods that need to be declared with 'newobject' - is this recommended way of doing things?

    Read the article

  • Count function calls by name or signature. Gcc, C++

    - by MajesticRa
    I have some c++ written package. Linux, gcc. I can modify compilation process (change Makefile, flags, etc.), but can not change C++ source code. One runs the package with different parameters, it does a job and exits. How to count: 1) Number of calls of function with specific name? 2) Number of calls of functions with specific signature? 3) Number of calls of functions where one of the parameters is of specific type i.e. std::string (type is specified by signature)? 4) and extra Number of calls of functions of STL objects, i.e. std::string copy constructor? (I mean count a number of calls during the run. ) I thought to do it with GDB, but I found it very tough to do (1) and have not found how to do (2)-(4) at all. All acceptable answers I will write here for humanity.

    Read the article

  • delphi finalizalization code in a DLL

    - by PA
    I am moving some functions to a shared DLL (I want to have some called as a Windows hook). The actual functions are currently in a unit, and it happens to have some initialization and some finalization code. I was initially thinking on doing a direct transformation from a unit to a library. So I moved the initialization code in between the main begin and end.. But then I realized I had no place to move the finalization code. I should create and register an special DLL entry point, instead. My question is. Can I leave the unit with all the functions and the initialization and finalization codes and just create a library stub that uses the unit? will the finalizationit be called?

    Read the article

  • trying to use PHP extract() within a function

    - by samuelf
    Hi, I have the two following files: main.php include("functions.php") __EXTRACT(); echo $testvar; functions.php function __EXTRACT(){ extract($_POST, EXTR_SKIP); } However, having a form with a textbox called testvar I can't get the extract function to extract the data.. if I remove the function call and insert it the extract statement directly into main.php it works. The include is not a problem as other functions in it works. Any ideas? Cheers

    Read the article

  • [C++] Passing around objects to network packet handlers ?

    - by xeross
    Hey, I've been writing a networking server for a while now in C++ and have come to the stage to start looking for a way to properly and easily handle all packets. I am so far that I can figure out what kind of packet it is, but now I need to figure out how to get the needed data to the handler functions. I had the following in mind: Have a map of function pointers with the opcode as key and the function pointer as value Have all these functions have 2 arguments, packet and ObjectAccessor ObjectAccessor class contains various functions to fetch various items such as users and alike Perhaps pass the user's guid too so we can fetch it from the objectaccessor I'd like to know the various implementations others have come up with, so please comment on this idea and reply with your own implementations. Thanks, Xeross

    Read the article

  • Python - How can I make this code asynchronous?

    - by dave
    Here's some code that illustrates my problem: def blocking1(): while True: yield 'first blocking function example' def blocking2(): while True: yield 'second blocking function example' for i in blocking1(): print 'this will be shown' for i in blocking2(): print 'this will not be shown' I have two functions which contain while True loops. These will yield data which I will then log somewhere (most likely, to an sqlite database). I've been playing around with threading and have gotten it working. However, I don't really like it... What I would like to do is make my blocking functions asynchronous. Something like: def blocking1(callback): while True: callback('first blocking function example') def blocking2(callback): while True: callback('second blocking function example') def log(data): print data blocking1(log) blocking2(log) How can I achieve this in Python? I've seen the standard library comes with asyncore and the big name in this game is Twisted but both of these seem to be used for socket IO. How can I async my non-socket related, blocking functions?

    Read the article

  • [jquery] Different function for same class on 'click' / 'dblclick'

    - by Shishant
    Hello, This are my two functions, on single click it works fine, but on dblclick both functions execute, any idea? I tried using live instead of delegate but still both functions execute on dblclick // Change Status on click $(".todoBox").delegate("li", "click", function() { var id = $(this).attr("id"); $.ajax({ //ajax stuff }); return false; }); // Double Click to Delete $(".todoBox").delegate("li", "dblclick", function(){ var id = $(this).attr("id"); $.ajax({ //ajax stuff }); return false; });

    Read the article

  • Generating tuples for tuples

    - by Nicola Bonelli
    Say you have a tuple and want to generate a new tuple by applying a metafunction on each type of the first one. What' the most efficient C++ metafuntion to accomplish to this task? Is it also possible to use C++0x variadic template to provide a better implementation?

    Read the article

  • Generating tuples from tuples

    - by Nicola Bonelli
    Say you have a tuple and want to generate a new tuple by applying a metafunction on each type of the first one. What' the most efficient C++ metafuntion to accomplish to this task? Is it also possible to use C++0x variadic template to provide a better implementation?

    Read the article

  • Call a constructor from variable arguments with PHP

    - by zneak
    Hello guys, I have a function that takes variadic arguments, that I obtain from func_get_args(). This function needs to call a constructor with those arguments. However, I don't know how to do it. With call_user_func, you can call functions with an array of arguments, but how would you call a constructor from it? I can't just pass the array of arguments to it; it must believe I've called it "normally". Thank you!

    Read the article

  • Why is there a sizeof... operator in C++0x?

    - by Motti
    I saw that @GMan implemented a version of sizeof... for variadic templates which (as far as I can tell) is equivalent to the built in sizeof.... Doesn't this go against the design principle of not adding anything to the core language if it can be implemented as a library function[citation needed]?

    Read the article

  • Python and Ruby in Tuxedo

    - by Maurice Gamanho
    With the release of SALT 11gR1, you can now develop Python/Ruby services/applications on Oracle Tuxedo platform. Python functions or Ruby classes can be invoked as Tuxedo services by other Tuxedo services or clients and, in addition, Python/Ruby applications can invoke existing Tuxedo services. SALT 11gR1 combines the proven scalability, reliability and performance of the Tuxedo runtime infrastructure with the agility provided by these dynamic scripting languages, providing a highly available and almost linearly scalable platform for Python and Ruby application development. Another benefit of developing Python and Ruby applications with Tuxedo is that services are SOA enabled from inception by virtue of Tuxedo's comprehensive integration options with J2EE app servers, mainframe applications, Web services, etc. Other interesting features are dynamic re-loading of scripts, where script changes are picked up automatically or when the administrator decides, and server-side typing, where Python functions and Ruby classes are given interfaces by way of the Tuxedo Metadata Repository. More information can be found on the Oracle SALT 11gR1 documentation page. See also SCA Python and Ruby Programming and Python and Ruby Data Type Mapping.

    Read the article

  • Block access to specific applications

    - by Jason Aren
    I would like to give several users rights to a computer running Ubuntu to do most administrative functions such as add/remove programs, save files, make settings changes, etc. However, I would like to block them from using several specific applications. Is this possible, and how would I do so? To provide a bit more detail: I am trying to set up Gnome Nanny to block adult websites from my kids' computer. I'd like to give them full access to the computer ACCEPT for Gnome Nanny. Windows has a program called K9 that cannot be turned off or uninstalled unless the user has the password EVEN if the user is an admin. Sounds like this isn't available on Ubuntu without a rather involved process of setting permissions on a large list of applications and functions to mimic admin rights.

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >