Search Results

Search found 38817 results on 1553 pages for 'inline function'.

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

  • Catching the return of main function before it deallocates resources

    - by EpsilonVector
    I'm trying to implement user threads in Linux kernel 2.4, and I ran into something problematic and unexpected. Background: a thread basically executes a single function and dies, except that when I call thread_create for the first time it must turn main() into a thread as well (by default it is not a thread until the first call, which is also when all the related data structures are allocated). Since a thread executes a function and dies, we don't need to "return" anywhere with it, but we do need to save the return value to be reclaimed later with thread_join, so the hack I came up with was: when I allocate the thread stack I place a return address that points to a thread_return_handler function, which deallocates the thread, makes it a zombie, and saves its return value for later. This works for "just run a function and die" threads, but is very problematic with the main thread. Since it actually is the main function, if it returns before the other threads finish the normal return mechanism kicks in, and deallocates all the shared resources, thus screwing up all the running threads. I need to keep it from doing that. Any ideas on how it can be done?

    Read the article

  • Getting Type mismatch for my function

    - by Sandy Williams
    I am getting an error message i.e. Type mismatch: 'EMXWEB_IE_LAUNCH' Line (1): "' ==============================================================================". the function is Option Explicit Public Function EMXWEB_IE_LAUNCH (dicArguments, sErrMsg) Dim strVersion Dim strExeVersion Dim WshShell Dim strEMXWebBrowserTitleBarText Dim ie Const strFunctionName = "EMXWEB_IE_LAUNCH" Set ie = CreateObject( "InternetExplorer.Application" ) ie.Navigate "www.google.com" ie.Visible=True End Function Could any one let me know where i am wrong and why i am getting this issue

    Read the article

  • How to call in C# function from Win32 DLL with custom objects

    - by marko
    How to use in C# function from Win32 DLL file made in Delphi. When function parameters are custom delphi objects? Function definition in Delphi: function GetAttrbControls( Code : PChar; InputList: TItemList; var Values : TValArray): Boolean; stdcall; export; Types that use: type TItem = packed record Code : PChar; ItemValue: Variant; end; TItemList = array of TItem; TValArray = array of PChar; Example in C# (doesn't work): [StructLayout(LayoutKind.Sequential)] public class Input { public string Code; public object ItemValue; }; [DllImport("Filename.dll", EntryPoint = "GetValues", CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetValues(string Code, Input[] InputList, ref StringBuilder[] Values);

    Read the article

  • JQuery\Javascript - Passing a function as a variable.

    - by Josh
    I was just curious if I could pass a function as a variable. For example: I have a function $('#validate').makeFloat({x:671,y:70,limitY:700}); I would like to do something like this: $('#validate').makeFloat({x:function(){ return $("#tabs").offset().left+$("#tabs").width();},y:70,limitY:700}); This does not work, but ideally every time the variable was accessed it would compute the new value. So if the window was resized it would automatically adjust as opposed to a variable passed in being static. I realize I can implement this directly inside the function\widget, but I was wondering if there was some way to do something like the above.

    Read the article

  • Attaching a jquery function to some textboxes

    - by diver-d
    I am a newbie to jquery and need a little help. I have created the below function which does what I want it to however when I select a textbox every other textbox are automatically selected. How do I change it and pass a parameter from the textbox so only the selected textboxes css changes on focus and blur? <script language="javascript" type="text/javascript"> $(function () { $('.myTextBox').focus(function () { $('.box.textbox').addClass("active"); }).blur(function () { $('.box.textbox').removeClass("active"); }); }); </script>

    Read the article

  • JavaScript inheritance extend function

    - by Zach
    I'm having some trouble understanding the IF clause at the end of this function from Pro JavaScript Design Patterns: function extend(subClass, superClass) { var F = function() {}; F.prototype = superClass.prototype; subClass.prototype = new F(); subClass.prototype.constructor = subClass; subClass.superclass = superClass.prototype; if(superClass.prototype.constructor == Object.prototype.constructor) { superClass.prototype.constructor = superClass; } } The book explains that these lines ensure that the superclass's constructor attribute is correctly set, even if the superclass is the Object class itself. Yet, if I omit those three lines and do the following: function SubClass() {}; extend(SubClass, Object); alert(Object.prototype.constructor == Object); The alert says 'true', which means the superclass's constructor is set correctly even without those last three lines. Under what conditions, then, does this IF statement do something useful? Thanks.

    Read the article

  • How do I create "undo" in c++?

    - by b3y4z1d
    I've got a couple of codes to do some things but I need to create a function that undoes the previous task/addition/change.How do I do this in Borland C++? (the program stores strings of text in a text file using "list",it is stored and then erased unless I use the save-function I've created) right,so I don't know if I've forgotten to mention anything of importance for you to be able to help me better,but if there's something you're wondering about the functions just ask. I meant creating an undo function in a simple consol application by the way.

    Read the article

  • jquery: Toggle elements based on result from a function

    - by Svish
    I have a number of table rows that I would like to toggle the visibility of. They should be visible if a data item I have set on them earlier equals a selected value in a form. This is what I have so far: $('#category-selector').change(function(event) { var category_id = $(this).val(); if(!category_id) { $('tr', '#table tbody').show(); } else { $('tr', '#table tbody').toggle(); } }); Of course this just toggles them on and off. Thing is that I thought I was able to give toggle a function that would decide if each row should be on or off, but it turns out I can only give it a boolean condition which would be an all or nothing deal kind of... So, I have this function: function() { return $(this).data('category_id') == category_id; } How can I use that to go through all the rows and toggle them on or off? Or is there a better approach to this? What should I do?

    Read the article

  • QueryString problem in .aspx - prints out nothing

    - by user321256
    I need to print out the querystring value "?type=xxx" inside my .aspx-page, why doesn't this work: <%= Request.QueryString("type") %> While this does: <%= Request.QueryString(0) %> The first prints out nothing, the second one prints out the value as expected, but it isn't always the first value I want... Any ideas?

    Read the article

  • How to make a C program that can run x86 hex codes

    - by Iowa15
    I have an array of hex codes that translate into assembly instructions and I want to create program in C that can execute these. unsigned char rawData[5356] = { 0x4C, 0x01, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x0C, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x2E, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x05, 0x00, 0x00, 0xA4, 0x01, 0x00, 0x00, 0x68, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x20, 0x00, 0x30, 0x60, 0x2E, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x30, 0xC0, 0x2E, 0x62, 0x73, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x30, 0xC0, 0x2F, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x58, 0x07, 0x00, 0x00, 0x32, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x10, 0x30, 0x60, 0x2F, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6C, 0x07, 0x00, 0x00,...and so on

    Read the article

  • How to access referenced table from ASPX in-line code (datagridview control)

    - by Grant
    Hi, i am trying to bind data to a datagridview control on an ASPX webpage and am using something like this.. <asp:TemplateField HeaderText="MyField"> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "MyField") %> </ItemTemplate> </asp:TemplateField> the problem i am having is that the data for the 'MyField' field is actually an integer that is a reference to a string value in another sql table. Does anyone know how i can reformat my code line above to show the string value instead of the int value?

    Read the article

  • Which button called the function?

    - by StoneBreaker
    I have two buttons which call the same function. That functions signature is - (IBAction)eraseTextField {...} I would like to figure out what button called the function. So I would like for the functions signature to be something like - (IBAction)eraseTextField: (id)sender {...}. Is there a way for the system to know to send the id of the calling object to a function that it calls? Thanks for the help.

    Read the article

  • Execute dynamic function with param in javascript

    - by Valamas
    if the following possible? I wish to move the alert(result) into a function and to dynamically call it. Current $.ajax(this.href, { success: function (result) { alert(result); AjaxComplete(); } }); My Attempt - not working $.ajax(this.href, { success: function (result) { window["MyAlert(result)"](); AjaxComplete(); } }); function MyAlert(result) { alert(result); } Is this possible?

    Read the article

  • How to use this piece of code in a function

    - by oliverbj
    I have this jQuery code: var vis = (function(){ var stateKey, eventKey, keys = { hidden: "visibilitychange", webkitHidden: "webkitvisibilitychange", mozHidden: "mozvisibilitychange", msHidden: "msvisibilitychange" }; for (stateKey in keys) { if (stateKey in document) { eventKey = keys[stateKey]; break; } } return function(c) { if (c) document.addEventListener(eventKey, c); return !document[stateKey]; } })(); vis(function(){ document.title = vis() ? 'Visible' : 'Not visible'; }); What it does now is to change the document title of the page. If the page is not visible, it will be changed to that and vise verca. My question is, how can I use this function like this: if page is visible{ //do something } if page is not visible{ //do something else }

    Read the article

  • odd behavior setting timeouts inside a function with global references in javascript

    - by Pablo
    Here is the the function and the globals: $note_instance = Array(); $note_count = 0; function create(text){ count = $note_count++; time = 5000; $note_instance[count] = $notifications.notify("create", text); setTimeout(function(){ $note_instance[count].close() }, time); } The function simply opens a notification, a sets a timeout to close it in 5 seconds. so if i call this create("Good Note 1"); create("Good Note 2"); create("Good Note 3"); Ecah note should close 5 seconds from their creation, however always and only the last note closes, in this case "Good Note 3". Each note object has its own entry in the the $note_instance global array so the timeouts should no be overwriting themselves. What am i missing here folks? Thanks in advance

    Read the article

  • Function pointers in javascript using django

    - by Hulk
    Is this a valid function pointer code below, In views , def change(request): dict={} function_ptr="create()" dict.update({'function_ptr' : function_ptr}) return render_to_response('mpjt/create.html',context_instance=RequestContext(request,{'dict': dict})) In create.html $(document).ready(function() { var a = '{{dict.function_ptr}}' func_ptr(a); function create() { alert('got respponse'); } }); Thanks..

    Read the article

  • Calling ASP.NET web service function via GET method with jQuery

    - by the_V
    Hi, I'm trying to call web service function via GET method using jQuery, but having a problem. This is a web service code: [WebService(Namespace = "http://something.com/samples")] [ScriptService] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class TestWebService : System.Web.Services.WebService { [WebMethod] public string Test2() { string result = null; try { result = "{'result':'success', 'datetime':'" + DateTime.Now.ToString() + "'"; } catch (Exception ex) { result = "Something wrong happened"; } return result; } } That's the way I call the function: $.ajax({ type: "GET", url: "http://localhost/testwebsite/TestWebService.asmx/Test2", data: "{}", contentType: "application/json", dataType: "json", error: function (xhr, status, error) { alert(xhr.responseText); }, success: function (msg) { alert('Call was successful!'); } }); Method is called successfully, but result string gets covered by XML tags, like this: <string> {'result':'success', 'datetime':'4/26/2010 12:11:18 PM' </string> And I get an error because of this (error handler is called). Does anybody know what can be done about this?

    Read the article

  • C - Call a function

    - by Pedro
    Hello. I want to get a value from a function in other function i think i have to call a function in other function, then call it on main, but how? void funcA(PEOPLE people[], int *total){ FILE *fp; char line[100]; fp=fopen("example.txt","r"); if(fp==NULL){ exit(1); } else{ fgets(line, 100, fp);//get a number from the txt total=atoi(linha);//convert to int } } void funcB(PEOPLE people[], int *total){ int i; for(i=0;i<total;i++){ printf("%s\n",people[i].name); } funcA(people,&total); } void main(){ PERSON person[100]; int *total; funcB(people,&total); } What i'm doing wrong?

    Read the article

  • passing paramter as to webservcie function in wcf

    - by prince23
    hi, this my datagrid event here i am calling the webservice. private void dgProject_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e) { WSDataServiceClient wsService = new WSDataServiceClient(); wsService.GetProjectCompleted += new EventHandler<GetProjectCompletedEventArgs>(wsService_GetProjectCompleted); wsService.GetProjectAsync(strUniqueName); // here can i send datagrid as an parameter to the function? Datagrid gd= new Datagrid(); } void wsService_GetProjectCompleted(object sender, GetProjectCompletedEventArgs e) { // } is there any way that i can send datagrid as a paramter to this function is it possiable to do? beacuse i will be using the same websevice function her but need to bind result with different datagrid based on the condition if i can send a datagrid as paramter to this function i can reduce the code so any help on this issue would be great thank you.

    Read the article

  • R: getting a function name as a string

    - by HamiltonUlmer
    Say I have a bunch of functions, each with something likeMyFunction.1, etc. I want to pass these functions into another function, which prints out a small report. Ideally I'd like to be able to label sections of a report by which function is being used to generate the results. So are there any nice ways of getting the name of a predefined function as a string?

    Read the article

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