Search Results

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

Page 21/364 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Casting functions -- Is it a code smell?

    - by Earlz
    I recently began to start using functions to make casting easier on my fingers for one instance I had something like this ((Dictionary<string,string>)value).Add(foo); and converted it to a tiny little helper function so I can do this ToDictionary(value).Add(foo); Is this a code smell? (also I've marked this language agnostic even though my example is C#)

    Read the article

  • Problem with upper-case and lower-case xpath functions in selenium IDE

    - by Aristotelis
    Hi, I am trying to get a xpath query using the xpath function lower-case or uppper-case, but they seem to not work in selenium (where I test my xpath before I apply it). Example that does NOT work: //*[.=upper-case('some text')] I have no problem locating the nodes I need in complex path and even using aggregated functions, as long as I don't use the upper and lower case. Has anyone encountered this before? Does it make sense? Thanks.

    Read the article

  • Lamda functions in php

    - by Oden
    Hey, Im really interested in the way of using lamda functions. Does it make sense to use them in a high-level programming language? If yes, why? Is this really just a function embedded in a function, (Like this) or is there more behind?

    Read the article

  • Why build Javascript functions as JQuery plugins?

    - by Mohammad
    I've seen alot of JQuery implementations of existent JavaScript functions that merely wrap the JavaScript code in a JQuery wrapper and don't actually rely on any of JQuery's base for their operation. What are the benefits of using Javascript as a JQuery plugin? If there are none is there a speed loss to use a JQuery plugin that could have easily been implemented outside the wrapper just as well? Many thanks in advance (just trying to learn something here).

    Read the article

  • Accidental Complexity in OpenSSL HMAC functions

    - by Hassan Syed
    SSL Documentation Analaysis This question is pertaining the usage of the HMAC routines in OpenSSL. Since Openssl documentation is a tad on the weak side in certain areas, profiling has revealed that using the: unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, int n, unsigned char *md, unsigned int *md_len); From here, shows 40% of my library runtime is devoted to creating and taking down **HMAC_CTX's behind the scenes. There are also two additional function to create and destroy a HMAC_CTX explicetly: HMAC_CTX_init() initialises a HMAC_CTX before first use. It must be called. HMAC_CTX_cleanup() erases the key and other data from the HMAC_CTX and releases any associated resources. It must be called when an HMAC_CTX is no longer required. These two function calls are prefixed with: The following functions may be used if the message is not completely stored in memory My data fits entirely in memory, so I choose the HMAC function -- the one whose signature is shown above. The context, as described by the man page, is made use of by using the following two functions: HMAC_Update() can be called repeatedly with chunks of the message to be authenticated (len bytes at data). HMAC_Final() places the message authentication code in md, which must have space for the hash function output. The Scope of the Application My application generates a authentic (HMAC, which is also used a nonce), CBC-BF encrypted protocol buffer string. The code will be interfaced with various web-servers and frameworks Windows / Linux as OS, nginx, Apache and IIS as webservers and Python / .NET and C++ web-server filters. The description above should clarify that the library needs to be thread safe, and potentially have resumeable processing state -- i.e., lightweight threads sharing a OS thread (which might leave thread local memory out of the picture). The Question How do I get rid of the 40% overhead on each invocation in a (1) thread-safe / (2) resume-able state way ? (2) is optional since I have all of the source-data present in one go, and can make sure a digest is created in place without relinquishing control of the thread mid-digest-creation. So, (1) can probably be done using thread local memory -- but how do I resuse the CTX's ? does the HMAC_final() call make the CTX reusable ?. (2) optional: in this case I would have to create a pool of CTX's. (3) how does the HMAC function do this ? does it create a CTX in the scope of the function call and destroy it ? Psuedocode and commentary will be useful.

    Read the article

  • Asp.net ajax event bind to two functions

    - by Chubbs
    hey Guys, I wanted to know if there's a way I can bind an Asp.net Ajax event to two different JS functions ? eg. var prm = Sys.WebForms.PageRequestManager.getInstance(); if (!prm.get_isInAsyncPostBack()) { prm.add_initializeRequest(InitializeRequest); prm.add_initializeRequest(InitializeRequest2); } function InitalizeRequest() { ... } function InitalizeRequest2() { ... }

    Read the article

  • Search for content in functions with regex

    - by Marlun
    Hello, How would I with regular expression search for functions which contains the use of a global variable without running "global $var" first? The files looks like this: class TestClass { function correctFunc() { global $var; $name = $var->name; } function invalidFuncIWantToFind() { $age = $var->user->age; } } I want to find the function names of all the invalidFuncIWantToFind. At work this would have really speeded up our work but I didn't get how to do it.

    Read the article

  • How to handle unknown initializer functions in lua?

    - by oofoe
    I want to load data written in a variant of lua (eyeonScript). However, the data is peppered with references to initialization functions that are not in plain lua: Redden = BrightnessContrast { Inputs = { Red = Input { Value = 0, }, }, } Standard lua gives "attempt to call a nil value" or "unexpected symbol" errors. Is there any way to catch these and pass it to some sort of generic initializer? I want to wind up with a nested table data structure. Thanks!

    Read the article

  • Javascript: Inline function vs predefined functions

    - by glaz666
    Can any body throw me some arguments for using inline functions against passing predefined function name to some handler. I.e. which is better: (function(){ setTimeout(function(){ /*some code here*/ }, 5); })(); versus (function(){ function invokeMe() { /*code*/ } setTimeout(invokeMe, 5); })(); Strange question, but we are almost fighting in the team about this

    Read the article

  • question about api functions

    - by davit-datuashvili
    i have question we have API functions in java can user create it's own function and add to his java IDE? for example i am using netbeans can i create my own function add to netbean IDE?let say create binary function or something else thanks

    Read the article

  • How to wrap two unmannaged C++ functions into two managed C# functions?

    - by Gbps
    I've got two unmanaged C++ functions, Compress and Decompress. The arguments and returns go as followed: unsigned char* Compress (unsigned char*,int) unsigned char* Decompress (unsigned char*,int) Where all uchars are arrays of uchars. Could someone please help me lay out a way to convert these into managed C# code using the Byte[] array instead of unsigned char*? Thank you very much!

    Read the article

  • What functions a lexer needs to provide?

    - by M28
    I am making a lexer, don't tell me to not do because I already did most of it. Currently it makes an array of tokens and that's it. I would like to know, what functions the lexer needs to provide and a brief explanation of what each function needs to do. I'll accept the most complete list. An example function would be: next: Consume the current token and return it

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >