Search Results

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

Page 73/364 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • DLL export of a static function

    - by Begbie00
    Hi all - I have the following static function: static inline HandVal StdDeck_StdRules_EVAL_N( StdDeck_CardMask cards, int n_cards ) Can I export this function in a DLL? If so, how? Thanks, Mike Background information: I'm doing this because the original source code came with a VS project designed to compile as a static (.lib) library. In order to use ctypes/Python, I'm converting the project to a DLL. I started a VS project as a DLL and imported the original source code. The project builds into a DLL, but none of the functions (including functions such as the one listed above) are exported (as confirmed by both the absence of dllexport in the source code and tools such as DLL Export Viewer). I tried to follow the general advice here (create an exportable wrapper function within the header) to no avail...functions still don't appear to be exported.

    Read the article

  • django app organization

    - by iHeartDucks
    I have been reading some django tutorial and it seems like all the view functions have to go in a file called "views.py" and all the models go in "models.py". I fear that I might end up with a lot of view functions in my view.py file and the same is the case with models.py. Is my understanding of django apps correct? Django apps lets us separate common functionality into different apps and keep the file size of views and models to a minimum? For example: My project can contain an app for recipes (create, update, view, and search) and a friend app, the comments app, and so on. Can I still move some of my view functions to a different file? So I only have the CRUD in one single file?

    Read the article

  • Sharepoint checkin/checkout

    - by Prashanth
    We have a sharepoint based application that uses a custom database for storing metadata/files (which could also be on a file share) My question is how can the standard file checkin/check out option in document library be customized? The javascript file ows.js in the layouts folder contains the functions that provide checkin/check out/ open file functionality. Behind the scenes it relies on a combination of HTTP Post/GET methods + SOAP + an activeX control to achieve the desired functionality. Customizing these javascript function seems tedious/error prone. Note that we have a web service that exposes endpoints, for retrieving necessary file information/data from the backend. The difficulty is in integrating it with the sharepoint js functions, due to lack of proper documentation. (Also the js functions might change over different versions of sharepoint) Also is it possible to create files/open files etc from the cache area on the client machine from server side code?

    Read the article

  • MS Environment: How to force link a static library to another using .vsprops, if possible?

    - by msbuildnewbie
    Environment: VS 2008 in Windows. Problem: A static library, say first.lib is not linked to, say second.lib, if first.lib is specified in .vsprops file and none of its functions is referenced in the second.lib. If, however, first.lib is removed from the .vsprops file and placed instead in the appropriate project options dialog(1), it is linked, even if its functions remain unreferenced. (1) Project - Properties - Configuration Properties - Linker - Input. Our solution uses .vsprops exclusively and to somehow be able to specify first.lib in such a file with additional tweaking of some settings would be considered a more elegant solution. Using a dummy function to pull in unused functions of first.lib is not an option. Thanks in advance.

    Read the article

  • How to properly use Gearman with my PHP application?

    - by luckytaxi
    For now I just want to use Gearman for background processing. For example, I need to email a recipient that they have a private message waiting for them once the sender submits their message into the DB. I assume I can run the worker/client and server on my primary server but I have no problems offloading some of the tasks to a different web server. Anyways, my question is how do I handle multiple "functions?" Let's say I need a job that handles the email portion and a job to handle image manipulation. Can I have multiple functions in the worker? I've followed a couple of examples I found online but each example only shows one function being initialized. Do I have to start up multiple "workers" to handle multiple functions?

    Read the article

  • mysql: encrypting and decrypting data

    - by cbrulak
    Does mysql provide a mechanism for storing and retrieving encrypted data? I don't mean passwords, I mean real strings. I'd like to encrypt a string, store in mysql and then retrieve the decrypted string at a later date. So, I know there is the AES_Encrypt and decrypt functions. But they ask for a key. (which is fine) but I wondering if you call those functions and use your user password as the key. Or something else that is super-simple. Also, is there a simple wrapper for the AES_Encrypt & decrypt functions in Rails? Or do you need to build the query manually?

    Read the article

  • Calling methods within same Javwscript class [Prototype]

    - by eldeejay
    I've created a class in Javscript using the prototype Class.Create complete with the initialize function and a few other functions. However, in one of my functions I want to reference another function in the same class, but cannot seem to get the syntax correct. e.g. var sampleClass = Class.create({ initialize: function(){ //do the init work here }, functionA: function(){ //do some more stuff here } functionB: function(){ //Do some stuff functionA() } } I've tried calling functionA() , this.functionA() but nothing works I just get errors. I know how to call the functions externally when the class has been instantiated, but not reference a function from within the class itself. Thanks

    Read the article

  • Difficulty thinking of properties for FsCheck

    - by Benjol
    I've managed to get xUnit working on my little sample assembly. Now I want to see if I can grok FsCheck too. My problem is that I'm stumped when it comes to defining test properties for my functions. Maybe I've just not got a good sample set of functions, but what would be good test properties for these functions, for example? //transforms [1;2;3;4] into [(1,2);(3,4)] pairs : 'a list -> ('a * 'a) list //' //splits list into list of lists when predicate returns // true for adjacent elements splitOn : ('a -> 'a -> bool) -> 'a list -> 'a list list //returns true if snd is bigger sndBigger : ('a * 'a) -> bool (requires comparison)

    Read the article

  • Python Pari Library?

    - by silinter
    Pari/GP is an excellent library for functions relating to number theory. The problem is that there doesn't seem to be an up to date wrapper for python anywhere around, (pari-python uses an old version of pari) and I'm wondering if anyone knows of some other library/wrapper that is similar to pari or one that uses pari. I'm aware of SAGE, but it's far too large for my needs. GMPY is excellent as well, but there are some intrinsic pari functions that I miss, and I'd much rather use python than the provided GP environment. NZMATH, mpmath, scipy and sympy were all taken into consideration as well. On a related note, does anyone have any suggestions on loading the pari dll itself and using the functions contained in it? I've tried to very little success, other than loading it and learning about function pointers.

    Read the article

  • javascript robot

    - by sarah
    hey guys! I need help making this robot game in javascript (notepad++) please HELP! I'm really confused by the functions <html> <head><title>Robot Invasion 2199</title></head> <body style="text-align:center" onload="newGame();"> <h2>Robot Invasion 2199</h2> <div style="text-align:center; background:white; margin-right: auto; margin-left:auto;"> <div style=""> <div style="width: auto; border:solid thin red; text-align:center; margin:10px auto 10px auto; padding:1ex 0ex;font-family: monospace" id="scene"></pre> </div> <div><span id="status"></span></div> <form style="text-align:center"> PUT THE CONTROL PANEL HERE!!! </form> </div> <script type="text/javascript"> // GENERAL SUGGESTIONS ABOUT WRITING THIS PROGRAM: // You should test your program before you've finished writing all of the // functions. The newGame, startLevel, and update functions should be your // first priority since they're all involved in displaying the initial state // of the game board. // // Next, work on putting together the control panel for the game so that you // can begin to interact with it. Your next goal should be to get the move // function working so that everything else can be testable. Note that all nine // of the movement buttons (including the pass button) should call the move // function when they are clicked, just with different parameters. // // All the remaining functions can be completed in pretty much any order, and // you'll see the game gradually improve as you write the functions. // // Just remember to keep your cool when writing this program. There are a // bunch of functions to write, but as long as you stay focused on the function // you're writing, each individual part is not that hard. // These variables specify the number of rows and columns in the game board. // Use these variables instead of hard coding the number of rows and columns // in your loops, etc. // i.e. Write: // for(i = 0; i < NUM_ROWS; i++) ... // not: // for(i = 0; i < 15; i++) ... var NUM_ROWS = 15; var NUM_COLS = 25; // Scene is arguably the most important variable in this whole program. It // should be set up as a two-dimensional array (with NUM_ROWS rows and // NUM_COLS columns). This represents the game board, with the scene[i][j] // representing what's in row i, column j. In particular, the entries should // be: // // "." for empty space // "R" for a robot // "S" for a scrap pile // "H" for the hero var scene; // These variables represent the row and column of the hero's location, // respectively. These are more of a conveniece so you don't have to search // for the "H" in the scene array when you need to know where the hero is. var heroRow; var heroCol; // These variables keep track of various aspects of the gameplay. // score is just the number of robots destroyed. // screwdrivers is the number of sonic screwdriver charges left. // fastTeleports is the number of fast teleports remaining. // level is the current level number. // Be sure to reset all of these when a new game starts, and update them at the // appropriate times. var score; var screwdrivers; var fastTeleports; var level; // This function should use a sonic screwdriver if there are still charges // left. The sonic screwdriver turns any robot that is in one of the eight // squares immediately adjacent to the hero into scrap. If there are no charges // left, then this function should instead pop up a dialog box with the message // "Out of sonic screwdrivers!". As with any function that alters the game's // state, this function should call the update function when it has finished. // // Your "Sonic Screwdriver" button should call this function directly. function screwdriver() { // WRITE THIS FUNCTION } // This function should move the hero to a randomly selected location if there // are still fast teleports left. This function MUST NOT move the hero on to // a square that is already occupied by a robot or a scrap pile, although it // can move the hero next to a robot. The number of fast teleports should also // be decreased by one. If there are no fast teleports left, this function // should just pop up a message box saying so. As with any function that alters // the game's state, this function should call the update function when it has // finished. // // HINT: Have a loop that keeps trying random spots until a valid one is found. // HINT: Use the validPosition function to tell if a spot is valid // // Your "Fast Teleport" button s

    Read the article

  • Adobe After Effects 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

  • How can I check if a particular jQuery UI function is available and use a different function if it i

    - by Mark B
    I'm writing a jQuery plugin and I would like my code to take advantage of the jQuery UI show(effect, [options], [speed], [callback]) and hide(effect, [options], [speed], [callback]) functions, which allow you to show and hide elements with a nice animation. However, I'd also like my plugin to degrade gracefully if jQuery UI isn't available, switching back to use the basic, non-animating show() and hide() functions present in the standard jQuery API. I'll need to test for the show and hide functions specifically, as even if jQuery UI is available it could potentially be a custom version, without the Effects components included. At first I thought that I might be able to do something like: if(typeof myelement.show('blind', 'slow') == 'undefined') { myelement.show('blind', 'slow'); } else { myelement.show(); } But of course this doesn't work, as even if UI isn't present, show() is still a function, it just has a different signature—so typeof returns object in either case. So, what's the best way for me to check if jQuery UI is available to my plugin? Any help is much appreciated!

    Read the article

  • Calling methods within same JavaScript class [Prototype]

    - by eldeejay
    I've created a class in Javscript using the prototype Class.Create complete with the initialize function and a few other functions. However, in one of my functions I want to reference another function in the same class, but cannot seem to get the syntax correct. e.g. var sampleClass = Class.create({ initialize: function(){ //do the init work here }, functionA: function(){ //do some more stuff here } functionB: function(){ //Do some stuff functionA() } } I've tried calling functionA() , this.functionA() but nothing works I just get errors. I know how to call the functions externally when the class has been instantiated, but not reference a function from within the class itself. Thanks

    Read the article

  • Get the lua command when a c function is called

    - by gamernb
    Supposed I register many different function names in Lua to the same function in C. Now, everytime my C function is called, is there a way to determine which function name was invoked? for example: int runCommand(lua_State *lua) { const char *name = // getFunctionName(lua) ? how would I do this part for(int i = 0; i < functions.size; i++) if(functions[i].name == name) functions[i].Call() } int main() { ... lua_register(lua, "delay", runCommand); lua_register(lua, "execute", runCommand); lua_register(lua, "loadPlugin", runCommand); lua_register(lua, "loadModule", runCommand); lua_register(lua, "delay", runCommand); } So, how do I get the name of what ever function called it?

    Read the article

  • Is there a programming language that performs currying when named parameters are omitted?

    - by Adam Gent
    Many functional programming languages have support for curried parameters. To support currying functions the parameters to the function are essentially a tuple where the last parameter can be omitted making a new function requiring a smaller tuple. I'm thinking of designing a language that always uses records (aka named parameters) for function parameters. Thus simple math functions in my make believe language would be: add { left : num, right : num } = ... minus { left : num, right : num } = .. You can pass in any record to those functions so long as they have those two named parameters (they can have more just "left" and "right"). If they have only one of the named parameter it creates a new function: minus5 :: { left : num } -> num minus5 = minus { right : 5 } I borrow some of haskell's notation for above. Has any one seen a language that does this?

    Read the article

  • JavaScript on Android randomly stops working

    - by AndersWid
    Hi! I have an application that uses a WebView and a html-page with javascript functions. Randomly the JavaScript functions doesn't seem to be called. It works up to a random point (I have looked at this bug all day) can only be produced on hardware (HTC Legend) not on emulator. Basicly I'm using callback to javaScript whenever the user presses a button, these callbacks tell the html to redraw using javaScript functions. mHandler.post(new Runnable() { public void run() { mWebView.loadUrl("javascript:getDataLine()"); } }); The first line in this javaScript code is an alert that says that it has started, so that I can see that it's working. Settings alerts or console.log's everywhere won't help as it seems the problem is in the webview or in Android itself. I need a way to see what's going on in the background. Maybe see if a previous call failed and stalled the thread or something.

    Read the article

  • Most efficient approach for multilingual PHP website

    - by alexteg
    I am working on a large multilingual website and I am considering different approaches for making it multilingual. The possible alternatives I can think of are: The Gettext functions with generation of .po files One MySQL table with the translations and a unique string ID for each text PHP-files with arrays containing the different translations with unique string IDs As far as I have understood the Gettext functions should be most efficient, but my requirement is that it should be possible to change a text string in the original reference language (English) without the other translations of that string automatically reverting back to English just because a couple of words changed. Is this possible with Gettext? What is the least resource demanding solution? Is using the Gettext functions or PHP files with arrays more or less equally resource demanding? Any other suggestions for more efficient solutions?

    Read the article

  • Error Downloading Metadata from ASMX Service

    - by michael.lukatchik
    It should be possible (and it looks like it is), but assume I have the following functions in my ASMX web service: [WebMethod(MessageName = "CreateExternalRpt1")] public bool CreateExternalRpt(int iProductId, int iOrderProductId, DateTime dtReportTime, string strReportTitle, string strReportCategory, string strReportPrintType, out string strSnapshot, string strApplicantFirst, string strApplicantLast, string strApplicantMiddle, string strOwnerLast, string strOwnerMiddle, string strOwnerFirst, bool blnCurrentReport, int iOrderId, bool blnFlag, string strCustomerId, string strUserId) { … } [WebMethod(MessageName = "CreateExternalRpt2")] public bool CreateExternalRpt(int iProductId, int iOrderProductId, DateTime dtReportTime, string strReportTitle, string strReportCategory, string strReportPrintType, string strReportSnapshot, string strApplicantFirst, string strApplicantLast, string strApplicantMiddle, string strOwnerLast, string strOwnerMiddle, string strOwnerFirst, bool blnCurrentReport, int iOrderId, bool blnFlag) { … } With both of these functions defined in my web service, my .NET client app can’t download the metadata and instead throws a generic error message “There was an error downloading…”. With one of the above methods removed, the .NET client app can successfully download the metadata. I’ve read that by decorating the WebMethod with a unique name, both functions should be exposed in the service metadata. This isn’t working. What am I missing?

    Read the article

  • how to deal with pdf annotation with ipad in objective c?

    - by Sarah
    Hello, I know that it may sound a silly question but i am really very confused. I am to work with one application that is having operations like PDF loading,annotation, scrolling,zooming and other such functions. Now my question is that i am little bit confused about what template i should use as i went through Quartz 2D Programming Guide and was little bit confused whether i'll be able to apply the above shown functions with the same guideline,as it displays the pdf page on the whole screen. Or is there any other way around? Please help me..Can i use UIWebView for the same functions as i listed above? I ll be grateful if you can help me. Thank you.

    Read the article

  • How to create a GUI inside a function in Matlab?

    - by Paperflyer
    Is there a possibility to write a GUI from inside a function? The Problem is: The callback of all GUI-functions work in the global workspace. But functions have their own workspace and can not access variables in the global workspace. Is there a possibility to make the GUI-functions use the workspace of the function? function myvar = myfunc() myvar = true; h_fig = figure; % create a useless button uicontrol( h_fig, 'style', 'pushbutton', ... 'string', 'clickme', ... 'callback', 'myvar = false' ); % wait for the button to be pressed while myvar pause( 0.2 ); end close( h_fig ); disp( 'this will never be displayed' ); end This event-loop will run indefinitely, since the callback will not modify myvar in the function. Instead it will create a new myvar in the global workspace.

    Read the article

  • PL DOC source forge - 2 issues

    - by user1792793
    I'm attempting to use PLDOC source forge (http://pldoc.sourceforge.net/maven-site/) with my code to generate a neat page with comments of my liking. I'm coming across 2 issues, any help would be appreciated. 1 I've been using tags (/**, */) to make comments and this works perfectly for functions, but does not appear in procedures. My Functions and procedures are independent and not in packages, and trying to add comments before the PROCEDURE declaration just gets deleted when saved. 2 if i try to use the recommended method of getting the data directly from teh database (call pldoc.bat -url jdbc:oracle:thin:@localhost:1521:ORCL -user SCOTT -password TIGER -sql SYS_OWNER.DBMS_PIPE,SYS_OWNER.DBMS_OUTPUT), it puts all the available functions and procedures under the user SIS_OWNER (SIS_owner is the only link available on the left hand side). I want to change this so that I can view all the methods in the list instead. Problem with procedures stated in 1 still exists with this method. Please let me know if you have overcome this and any pointers would be great. Thanks

    Read the article

  • Can GraphViz be used for a graph editing GUI?

    - by user185420
    I am creating an application which will allow a developer to create a program flow-chart by selecting pre-defined functions from a ToolBox (which will show up as small graphical elements). In other words, developer will select one or more pre-defined functions (graphical elements) from ToolBox and drag-drop on the main work area. The application will then, based on the flow of functions selected, will auto-generate ready-to-compile-code. I looked a GraphViz, but am not sure whether it can be used to create a GUI IDE for editing graphical elements. I am looking for a functionality similart to Microsoft Visio, where users can add/remove/drag-drop/ various shapes to create a diagram. Does GraphViz fit in here? If yes, can you direct me to some examples showing how to do it? If GraphViz cannot be used, what are the other open source/free components available? I am intending to build the final application in .Net.

    Read the article

  • JavaScript helper libraries? No DOM or AJAX stuff

    - by Melmacian
    As I'm writing JavaScript I'm always missing some fairly basic language features that JavaScript just don't have. So is there any library that would bring such features as trim, sprintf, str.endwith and etc. functions to JavaScript ? I just have written those functions too many times and I'm also tired of copy/pasting them from my old code. It would be nice to have some library which has those implemented and tested in one place. Note that I'm not talking about Ajax/DOM-libraries like jQuery or Dojo and such. I know that those libraries bring some of the features that I'm talking here, but not all. And I would like to have also an environment independent library so that same library could be used with server side JavaScript . Best library so far that I've found is php.js, but I don't like how it is polluting the global namespace. I'm also not too fond of how PHP-functions are named.

    Read the article

  • Is There A Central Repository of Javascript Information?

    - by Brian
    For example, if you want information of PHP functions, you can go to http://www.php.net/ . If you want information of Perl functions you can to to http://www.cpan.org/ and/or use perldoc. If you want information on Java you can go to http://java.sun.com and/or use javadoc. However, if you want information on Javascript methods/functions and their attributes, return values, etc. where do you go? The reason I ask is I was playing with the "focus()" method and wondering if it could be passed any values or if it returned anything when called. I have done a cursory Google search but haven't found much. Does such a beast exist or am I out of luck? Thanks for reading, and have a good day.

    Read the article

  • Can any function be a deleted-function?

    - by Caspin
    The working draft explicitly calls out that defaulted-functions must be special member functions (eg copy-constructor, default-constructor, etc). Which makes perfect sense. However, I don't see any such restriction on deleted-functions. Is that right? Or in other words are these three examples valid c++0? struct Foo { // 1 int bar( int ) = delete; }; // 2 int baz( int ) = delete; template< typename T > int boo( T t ); // 3 template<> int boo<int>(int t) = delete;

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >