Search Results

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

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

  • write jquery plugin

    - by tazphoenix
    hi.i wrote a jquery function and now i want to use it as a plugin so i could use that more than 1 place.the code lookes like this: function loadTable(){ $.post("includes/action.php", {action: "gettable"}, function(html){ $("#tblstudents tbody").html(html); $("#tblstudents") .tablesorter({widthFixed: false, widgets: ['zebra'], sortList: [[0,0]]}) .tablesorterPager({container: $("#pager")}) .tablesorterFilter({filterContainer: $("#filter-box"), filterClearContainer: $("#filter-clear-button")}); }); } And I want it have functions for setting "includes/action.php" and "gettable" in $.post function and $("#pager") ,$("#filter-box") and $("#filter-clear-button") from $("#tblstudents").Can anyone help me?

    Read the article

  • Is there possible in clojure to make a deadlock (or anything bad case) using agents?

    - by hsestupin
    CLojure agents is powerful tool. So actions to the agents are asynchronously sent using functions "send" and "send-off". And in theory there couldn't appear something like deadlock. Is there possible to write some clojure code (for example invoking from some action another action to another agent) using agents in which we have some concurrency problem - it could be deadlock, race condition or anything else. (guys, i'm very sorry for my english)

    Read the article

  • How to get all captures of subgroup matches with preg_match_all()?

    - by hakre
    Update/Note: I think what I'm probably looking for is to get the captures of a group in PHP. Referenced: PCRE regular expressions using named pattern subroutines. (Read carefully:) I have a string that contains a variable number of segments (simplified): $subject = 'AA BB DD '; // could be 'AA BB DD CC EE ' as well I would like now to match the segments and return them via the matches array: $pattern = '/^(([a-z]+) )+$/i'; $result = preg_match_all($pattern, $subject, $matches); This will only return the last match for the capture group 2: DD. Is there a way that I can retrieve all subpattern captures (AA, BB, DD) with one regex execution? Isn't preg_match_all suitable for this? This question is a generalization. Both the $subject and $pattern are simplified. Naturally with such the general list of AA, BB, .. is much more easy to extract with other functions (e.g. explode) or with a variation of the $pattern. But I'm specifically asking how to return all of the subgroup matches with the preg_...-family of functions. For a real life case imagine you have multiple (nested) level of a variant amount of subpattern matches. Example This is an example in pseudo code to describe a bit of the background. Imagine the following: Regular definitions of tokens: CHARS := [a-z]+ PUNCT := [.,!?] WS := [ ] $subject get's tokenized based on these. The tokenization is stored inside an array of tokens (type, offset, ...). That array is then transformed into a string, containing one character per token: CHARS -> "c" PUNCT -> "p" WS -> "s" So that it's now possible to run regular expressions based on tokens (and not character classes etc.) on the token stream string index. E.g. regex: (cs)?cp to express one or more group of chars followed by a punctuation. As I now can express self-defined tokens as regex, the next step was to build the grammar. This is only an example, this is sort of ABNF style: words = word | (word space)+ word word = CHARS+ space = WS punctuation = PUNCT If I now compile the grammar for words into a (token) regex I would like to have naturally all subgroup matches of each word. words = (CHARS+) | ( (CHARS+) WS )+ (CHARS+) # words resolved to tokens words = (c+)|((c+)s)+c+ # words resolved to regex I could code until this point. Then I ran into the problem that the sub-group matches did only contain their last match. So I have the option to either create an automata for the grammar on my own (which I would like to prevent to keep the grammar expressions generic) or to somewhat make preg_match working for me somehow so I can spare that. That's basically all. Probably now it's understandable why I simplified the question. Related: pcrepattern man page Get repeated matches with preg_match_all()

    Read the article

  • How to append to an array that contains blank spaces - Java

    - by Cameron Townley
    I'm trying to append to a char[] array that contains blank spaces on the end. The char array for example contains the characters 'aaa'. When I append the first time the method functions properly and outputs 'aaabbb'. The initial capacity of the array is set to 80 or multiples of 80. The second time I try and append my output looks like"aaabbb bbb". Any psuedocode would be great.

    Read the article

  • Traverse a XML using Recursive function

    - by Kaja
    How can I traverse (read all the nodes in order) a XML document using recursive functions in c#? What I want is to read all the nodes in xml (which has attributes) and print them in the same structure as xml (but without Node Localname) Thanks

    Read the article

  • Why is T() = T() allowed in C++?

    - by Rimo
    I believe the expression T() creates an rvalue (by the Standard) However the following code compiles (at least on gcc4.0) class T {... }; int main() { T() = T(); } I know technically this is possible because member functions can be invoked on temporaries and the above is just invoking the operator= on the r-value temporary created from T(). But conceptually this is like assigning a new value to an r-value. Is there a good reason why this is allowed?

    Read the article

  • Passing function-specific variables

    - by Simon Carlson
    Say I got two functions that looks like this: function main(Index) { doStuff(); } function doStuff() { if(Index == 1) { document.write("Hello world!") } } And some HTML: <input type="button" value="Click me" onclick="main(1)" /> I realize this is a very stupid way to use function-specific variables and such, but it's just out of curiosity. So is it possible to pass the variable Index from the main function to the doStuff function?

    Read the article

  • Is There A Way To Apply CODE Formatting To A VB.Net TextBox?

    - by Jeff
    I'm playing with a simple string replacement editor for editing VB.Net functions outside of VB. Is there a way to apply VB.Net code formatting to a string? For example. The txtboxCodeEntry looks like this: If strVar="dummy" then 1 else 0 Endif I would like it to "autoformat" to: If strVar = "dummy" Then 1 Else 0 End If The formatting would match whatever formatting VB.Net does when you're editing code in the Visual Studio IDE. Thanks.

    Read the article

  • No warning from gcc when function definition in linked source different from function prototype in h

    - by c_c
    Hi, I had a problem with a part of my code, which after some iterations seemed to read NaN as value of a int of a struct. I think I found the error, but am still wondering why gcc (version 3.2.3 on a embedded Linux with busybox) did not warn me. Here are the important parts of the code: A c file and its header for functions to acquire data over USB: // usb_control.h typedef struct{ double mean; short *values; } DATA_POINTS; typedef struct{ int size; DATA_POINTS *channel1; //....7 more channels } DATA_STRUCT; DATA_STRUCT *create_data_struct(int N); // N values per channel int free_data_struct(DATA_STRUCT *data); int aqcu_data(DATA_STRUCT *data, int N); A c and header file with helper function (math, bitshift,etc...): // helper.h int mean(DATA_STRUCT *data); // helper.c (this is where the error is obviously) double mean(DATA_STRUCT *data) { // sum in for loop data->channel1->mean = sum/data->N; // ...7 more channels // a printf here displayed the mean values corretly } The main file // main.c #include "helper.h" #include "usb_control.h" // Allocate space for data struct DATA_STRUCT *data = create_data_struct(N); // get data for different delays for (delay = 0; delay < 500; delay += pw){ acqu_data(data, N); mean(data); // printf of the mean values first is correct. Than after 5 iterations // it is always NaN for channel1. The other channels are displayed correctly; } There were no segfaults nor any other missbehavior, just the NaN for channel1 in the main file. After finding the error, which was not easy, it was of course east to fix. The return type of mean(){} was wrong in the definition. Instead of double mean() it has to be int mean() as the prototype defines. When all the functions are put into one file, gcc warns me that there is a redefinition of the function mean(). But as I compile each c file seperately and link them afterwards gcc seems to miss that. So my questions would be. Why didn't I get any warnings, even non with gcc -Wall? Or is there still another error hidden which is just not causing problems now? Regards, christian

    Read the article

  • What's the formal name for this Syntax?

    - by rlb.usa
    Sometimes in Scheme, I have functions that take arguments like this add 3 4 What do you call this kind of "list" where it's elements are like a1 a2 a3 ? I don't think you can call it a list because lists are contained in parenthesis and elements are comma-seperated.

    Read the article

  • *iPhone* Unable to symbolicate in Object Allocations instrument

    - by AkademiksQc
    Hi there, i run a C++ app from objective-c I can successfully symbolicate my function names using Shark profiler but not with the Object Allocations instrument.à In the detailed pane, i only see my C++ app name with the hexadecimal value for my C++ functions. I tried to do a "File/Re-Symbolicate Document", selecting my app folder containing both my app and my Dsym file but nothing change. Any clues? My config: xCode 3.2.2 iPhonoe SDK 3.2 Snowleopard (10.6.3) Thx.

    Read the article

  • JavaScript date comparisons

    - by Kyle
    I am new to the lower level useful functions of JavaScript, and I find myself needing to compare two date objects, but within an hourly range. For example, if Date1 is less then two hours until (or from) Date2. How could this be done?

    Read the article

  • How to check if String value is Boolean type in Java?

    - by Ragnar
    I did a little search on this but couldn't find anything useful. The point being that if String value is either "true" or "false" the return value should be true. In every other value it should be false. I tried these: String value = "false"; System.out.println("test1: " + Boolean.parseBoolean(value)); System.out.println("test2: " + Boolean.valueOf(value)); System.out.println("test3: " + Boolean.getBoolean(value)); All functions returned false :(

    Read the article

  • Identifying if a user is in the local administrators group

    - by Adam Driscoll
    My Problem I'm using PInvoked Windows API functions to verify if a user is part of the local administrators group. I'm utilizing GetCurrentProcess, OpenProcessToken, GetTokenInformationand LookupAccountSid to verify if the user is a local admin. GetTokenInformation returns a TOKEN_GROUPS struct with an array of SID_AND_ATTRIBUTES structs. I iterate over the collection and compare the user names returned by LookupAccountSid. My problem is that, locally (or more generally on our in-house domain), this works as expected. The builtin\Administrators is located within the group membership of the current process token and my method returns true. On another domain of another developer the function returns false. The LookupAccountSid functions properly for the first 2 iterations of the TOKEN_GROUPS struct, returning None and Everyone, and then craps out complaining that "A Parameter is incorrect." What would cause only two groups to work correctly? The TOKEN_GROUPS struct indicates that there are 14 groups. I'm assuming it's the SID that is invalid. Everything that I have PInvoked I have taken from an example on the PInvoke website. The only difference is that with the LookupAccountSid I have changed the Sid parameter from a byte[] to a IntPtr because SID_AND_ATTRIBUTESis also defined with an IntPtr. Is this ok since LookupAccountSid is defined with a PSID? LookupAccountSid PInvoke [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern bool LookupAccountSid( string lpSystemName, IntPtr Sid, StringBuilder lpName, ref uint cchName, StringBuilder ReferencedDomainName, ref uint cchReferencedDomainName, out SID_NAME_USE peUse); Where the code falls over for (int i = 0; i < usize; i++) { accountCount = 0; domainCount = 0; //Get Sizes LookupAccountSid(null, tokenGroups.Groups[i].SID, null, ref accountCount, null, ref domainCount, out snu); accountName2.EnsureCapacity((int) accountCount); domainName.EnsureCapacity((int) domainCount); if (!LookupAccountSid(null, tokenGroups.Groups[i].SID, accountName2, ref accountCount, domainName, ref domainCount, out snu)) { //Finds its way here after 2 iterations //But only in a different developers domain var error = Marshal.GetLastWin32Error(); _log.InfoFormat("Failed to look up SID's account name. {0}", new Win32Exception(error).Message); continue; } If more code is needed let me know. Any help would be greatly appreciated.

    Read the article

  • how do i get ajax to call after previous success is complete

    - by Alessandro
    I am currently using this ajax queuing plugin http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/ and it works fine, except weh ajax call 1 finishes, ajax call 2 starts that is dependent on a value that the success functions generates when ajax 1 is complete. Is there a way to start of all ajax calls when the previous call is complete and success function has been run? thanks

    Read the article

  • How are classes more 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

  • [C++] Is it possible to roll a significantly faster version of sqrt

    - by John
    In an app I'm profiling, I found that in some scenarios this functions are able to take over 10% of total execution time. I've seen discussion over the years of faster sqrt implementations using sneaky floating-point trickery, but I don't know if such things are outdated on modern CPUs. MSVC++ 2008 compiler is being used, for reference... though I'd assume sqrt is not going to add much overhead though.

    Read the article

  • Correct place to load an extension in WordPress

    - by Quassnoi
    My hosting provider does not have curl extension enabled by default, however, I can load it using dl(). What would be the correct place in WordPress to load the extension so that it could use curl for wp_remote_* functions? I'd like it to survive the possible upgrades of WordPress code.

    Read the article

  • Get info for remote audio files

    - by Yola
    to get metadata for audio file i can use: NSDictionary *aMetadata = [aPath MDIAttributes:[aPath allMDIAttributesNames]]; but it doesn't work with remote files, in case of images i solved this problem with CGImageSourceRef and so on functions. Does anybody know something like this for audio files?

    Read the article

  • Enumerate over an enum in C++

    - by jameszhao00
    In C++, Is it possible to enumerate over an enum (either runtime or compile time (preferred)) and call functions/generate code for each iteration? Sample use case: enum abc { start a, b, c, end } for each (__enum__member__ in abc) { function_call(__enum__member__); } Plausible duplicates: C++: Iterate through an enum Enum in C++ like Enum in Ada?

    Read the article

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