Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 171/297 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • How do customize the g:sortableColumn?

    - by kakaotalk
    Well, I have one column in my list that I need to customize, the thing is grails' own g:sortable doesn't work. For instance, my first column shows employee ids, then my second column, shows the employees full name where full name is a combination of first name and last name. I got it to work, sorting and all, but when I try to place it in a table with g:sortable, the g:sortable just wouldn't work. I'm thinking about passing params around but it's a bit tricky. Any suggestions? I've looked around the internet, and seems like nothing. :\

    Read the article

  • 2 ajax forms on the same page posting same textbox

    - by rod
    Hi All, Is it possible to post, say like a value in a textbox, to 2 different ajax forms that are on the same page? It doesn't have to be at the same time? What I'm trying to do is this: I have a search page that searches for customers and displays them on a paged grid. Users can specify up to 5 parameters (5 textboxes) to narrow the search. On the same page I have an export option. Well since I want all the customers for the search and not just the paged data I need a way to post back to the server for this option passing the same parameters used in the grid. I'm using a ViewModel which would be nice if I can pass that back to the server rather than the individual search fields that are backed by the view model. Thanks, rodchar

    Read the article

  • undefined index mode, which is the variable that case statement is looking for

    - by Brad
    receiving error: PHP Notice: Undefined index: mode in /web/ee_web/include/form-modal.php on line 51 line 51 switch($_GET["mode"]) { block of code it is in: switch($_GET["mode"]) { case "login": login_user(); break; case "logout": session_destroy(); print "<p>You are now logged out.</p>"; print "<p><input type=\"submit\" id=\"closeButton\" name=\"closeButton\" value=\"Close\" onclick=\"self.parent.tb_remove(); parent.location.reload(1);\" /></p>"; break; default: login_user(); //print "<p>How'd you end up here?</p>"; break; } The URL for the page is index.php?mode=logout, that is how I am passing the value into mode. Any way I could resolve this error message?

    Read the article

  • Call function by pointer and set parametrs in memory block

    - by Ellesmess Glain
    Hi, I've little problem : I'm solving problem with calling function by pointer and passing to it parameters in continuous memory block. My goal is to have function named e.g CallFunc(void * func,void *params, unsigned int param_length); that I'll send function pointer, pointer to function's parameters and eventually parameters length and this calling function will call passed function with it's parameters. I will like write this in C/C++, but if somebody has idea, how this resolve in other language, that supports DLL generation and exportet functions, it will be fine too. Thanks for answers, Ellesmess P.S. I'm sorry about my English, but I'm Czech, thanks :o)

    Read the article

  • Django GenericRelation doesn't save related object's id - is this a bug or am I doing it wrong?

    - by pinkeen
    I have a model with a generic relation (call it A), when creating an instance of this object I pass an instance of another model (call it B) as the initializer of the content_object field (via kwargs of the constructor). If I don't save B before creating A then when saving A the content_object_id is saved to the db as NULL. If I save B before passing it to the constructor of A then everything's allright. It's not logical. I assumed that the ID of the related object (B) is fetched when doing A.save() and it should throw some kind of an exception if B isn't saved yet but it just fails silently. I don't like the current solution (saving B beforhand) because we don't know yet if I will be always willing to keep the object, not just scrap it, and there are performance considerations - what if I will add some another data and save it once more shortly after. class BaseNodeData(models.Model): ... extnodedata_content_type = models.ForeignKey(ContentType, null=True) extnodedata_object_id = models.PositiveIntegerField(null=True) extnodedata = generic.GenericForeignKey(ct_field='extnodedata_content_type', fk_field='extnodedata_object_id') class MarkupNodeData(models.Model): raw_content = models.TextField() Suppose we do: markup = MarkupNodeData(raw_content='...') base = BaseNodeData(..., extnodedata=markup) markup.save() base.save() # both records are inserted to the DB but base is stored with extnodedata_object_id=NULL markup = MarkupNodeData(raw_content='...') base = BaseNodeData(..., extnodedata=markup) base.save() markup.save() # no exception is thrown and everything is the same as above markup = MarkupNodeData(raw_content='...') markup.save() base = BaseNodeData(..., extnodedata=markup) base.save() # this works as expected Of course I can do it this way, but it doesn't change anything: base = BaseNodeData(...) base.extnodedata = markup My question is - is this a bug in django which I should report or maybe I'm doing something wrong. Docs on GenericRelations aren't exactly verbose.

    Read the article

  • javascript function pointer and "this"

    - by Justin808
    I'm passing a method as a variable to be used as a callback. When its called, the "this" is not the object the method is a member of. How do I go about getting access to the method's object instance so I can get access to it variables and other member functions? I have no control over the callback call method, its a separate library. All I do is call the binding from my object init method. I would have expected this inside my _connection method to have been its object. jsPlumb.bind('connection', this._connection);

    Read the article

  • MySQL Query : Advise Needed.

    - by Rachel
    "SELECT id as Id from dbTable WHERE code = ? AND CURDATE() BETWEEN start_date AND end_date AND offerId IN ('12321', '12124')"; //Passing arguments for the query $args = array_merge(array(51342),$offerid); //Execute the prepared query $statement->execute($args); Now array(51342) represents combination of code+value, aside my database has value, code columns and so I want a query which would look logically like "SELECT id as Id from dbTable WHERE code and value (Note here I do not know the syntax, what am looking at is (code+value = ?), please advise on query) = ? AND CURDATE() BETWEEN start_date AND end_date AND offerId IN ('12321', '12124')";

    Read the article

  • How to monitor a folder and trigger a command-line action when a file is created or edited?

    - by bigmattyh
    I need to set up some sort of a script on my Vista machine, so that whenever a file is added to a particular folder, it automatically triggers a background process that operates on the file. (The background process is just a command-line utility that takes the file name as an argument, along with some other predefined options.) I'd like to do this using native Windows features, if possible, for performance and maintenance reasons. I've looked into using Task Scheduler, but after perusing the trigger system for a while, I haven't been able to make much sense of it, and I'm not even sure if it's capable of doing what I need. I'd appreciate any suggestions. Thanks!

    Read the article

  • Django forms: prepopulate form with request.user and url parameter

    - by Malyo
    I'm building simple Course Management App. I want Users to sign up for Course. Here's sign up model: class CourseMembers(models.Model): student = models.ForeignKey(Student) course = models.ForeignKey(Course) def __unicode__(self): return unicode(self.student) Student model is extended User model - I'd like to fill the form with request.user. In Course model most important is course_id, which i'm passing into view throught URL parameter (for example http://127.0.0.1:8000/courses/course/1/). What i want to achieve, is to generate 'invisible' (so user can't change the inserted data) form with just input, but containing request.user and course_id parameter.

    Read the article

  • Java synchronizing static list ?

    - by JavaUser
    Hi, In a Java class , i am having a static list so this list is shared across all the objects of this class.The business logic in this class will run periodically which is invoked by some method with out passing instance parameters.Now I want to invoke this run method based on the list(I will add some vales into this list based on JMS) ,this list may empty sometimes and after finishing the run , i am emptying this list.Now my question is , whether I need to synchronize this list or not? Also let me know is there any other way to pass value in one object instance(Thread1) to other object instance (Thread2) other than having Static variable(static list)? Thx

    Read the article

  • Rails - How to secure foreign keys and still allow association selection

    - by Bryce
    For simplicity, assume that I have a simple has-many-through relationship class User < ActiveRecord::Base has_many :courses, :through => :registrations end class Registration < ActiveRecord::Base belongs_to :user belongs_to :course end class Course < ActiveRecord::Base has_many :users, :through => :registrations end I want to keep my app secure, so I use attr_accessible to whitelist my attributes. My question is twofold: How would I set up my whitelist attributes such that I could create a new Registration object through a form (passing in :user and :course, but not risk allowing those foreign keys to be maliciously updated later? How would I set up my validations such that both belongs_to associations are required BUT also allow for Registration objects to be created in nested forms?

    Read the article

  • Get params value from component Joomla 3.0

    - by yogeshK
    I have saved value like this in my component table fields params. unique=1 default_value=Default validate=Validate validate_error_msg=Validate error messag searchable=1 Now i want to get value in my component.So I am passing values in my component's view.html.php in this way $params = new JForm($row->params); but its not working. Now I want to get value so I am taking like this $this->params->getValue('default_value'); But its not work where as in Joomla 2.5 ,we can get value like this $this->params->get('default_value');

    Read the article

  • Calling R Script from within C-Code

    - by tiny81
    Hi, Is there a way to call an R-Script within C-Code? I did find the R Api for C (chaper 6. of the 'Writing R Extensions' manual), but as far as I understood this does "only" allow to call the C-Implementation of R. Of cause I could call the R-Script via shell, but that's no solution for me, since this does not allow proper passing of data (at least no if I don't what to write the data into a Csv-File or something like this). Is there a easy way of using the R to C parser beforehand? Any hints you can give me? regards, Tiny

    Read the article

  • Starting a SKProductsRequest gives -[_NSCFArray length] invalid selector error a moment later. LoadMicroPaymentsProductsOperation error.

    - by quantumpotato
    I'm fetching a list of identifiers from my server, then passing them off in a products request to Apple. Here's my code, and below is the error I'm getting. The iPhone 4 is not crashing when this happens. -(void)didReceiveData:(NSArray *)data { NSLog(@"Received Identifiers: %@",data); NSSet *productIdentifiers = [NSSet setWithArray:data]; SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; productsRequest.delegate = self; [productsRequest start]; NSLog(@"productsRequest should have started by now"); } Wed Dec 29 09:42:14 iPhone XXXX-iphone[6363] <Warning>: Received Identifiers: ( ( 1, 10, "com.XXXX.XXXX.10" ) ) Wed Dec 29 09:42:14 iPhone XXXX-iphone[6363] <Warning>: productsRequest should have started by now Wed Dec 29 09:42:18 iPhone itunesstored[6367] : -[__NSCFArray length]: unrecognized selector sent to instance 0x119070 Wed Dec 29 09:42:18 iPhone itunesstored[6367] : caught -[__NSCFArray length]: unrecognized selector sent to instance 0x119070 exception with stack trace: (0x33ac0975 0x3347b49d 0x33ac2133 0x33a69aa9 0x33a69860 0x2717b 0x27515 0x31469651 0x314693ed 0x31469e39 0x3362795f 0x336276c3 0x3363c4eb 0x33c32680 0x33c32ba0 0x33bd7251 0x33bcf978)

    Read the article

  • Given a user control with a form containing validation can I validate entirely server side?

    - by JoshBaltzell
    We have an existing User Control that was built to dynamically generate a web form for an end user. This form includes required field validators, custom validators that use server side code and Regular Expression validatiors. We now have a need to use all these validators to verify that all the needed data is entered when using a separate ordering process that cannot be validated in the same way, but has the same validation requirements before it is added to the database. I would like to use this user control to validate the input by passing it all the values and checking the validation summary. The only way I know how to do this is to render it to a page on the client side and trigger the form submit. Is there any way to populate and validate a web form entirely on the server side?

    Read the article

  • Get the javascript variable in formsubmit

    - by Sakthivel
    HI friends i have the issue in screen scrapping , in the page the links are available as follows , <a id="linkbuttonAlphaA" href="javascript:__doPostBack('linkbuttonAlphaA','')">A</a> <a id="linkbuttonAlphaB" href="javascript:__doPostBack('linkbuttonAlphaB','')">B</a> <a id ="linkbuttonAlphaC"ref="javascript:__doPostBack('linkbuttonAlphaC','')">C</a> and the __doPostBack function contains this function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } in this is it possible to set the eventtarget and eventArgumnet manually ? that means by passing that values in URL and call the __doPostBack function ? Please help me to find out this . Thanks in advance.

    Read the article

  • PHP: reusing database class

    - by citricsquid
    Hi, I built a class that allows me to do: $db->query($query); and it works perfectly, although if I want to do: $db->query($query); while($row = $db->fetch_assoc()){ $db->query($anotherquery); echo $db->result(); } it "breaks" the class. I don't want to constantly have to redeclare my class (eg: $seconddb = new database()), is there a way to get around this? I want to be able to reuse $db within $db, without overwriting the "outside" db. currently I'm create an array of data (from db-fetch_assoc() then doing a foreach and then doing the db call inside that: $db->query('SELECT * FROM table'); while($row = $db->fetch_assoc()){ $arr[] = $row; } foreach($arr as $a){ $db->query(); // query and processing here } Is this the best method or am I missing the obvious? Should I consider passing a connection link ID with the database connection?

    Read the article

  • How to discard const in c++

    - by Vincenzo
    This is what I'm trying to do and I can't: #include <string> using namespace std; class A { bool has() const { return get().length(); } string& get() { return s; } private: string s; }; The error I'm getting is: passing ‘const A’ as ‘this’ argument of ‘std::string& A::get()’ discards qualifiers I understand what the problem is, but how can I fix it? I really need has() to be const. Thanks.

    Read the article

  • Running a loop (such as one for a mock webserver) within a thread

    - by bob c
    I'm trying to run a mock webserver within a thread within a class. I've tried passing the class' @server property to the thread block but as soon as I try to do server.accept the thread stops. Is there some way to make this work? I want to basically be able to run a webserver off of this script while still taking user input via stdin.gets. Is this possible? class Server def initialize() @server = TCPServer.new(8080) end def run() @thread = Thread.new(@server) { |server| while true newsock = server.accept puts "some stuff after accept!" next if !newsock # some other stuff end } end end def processCommand() # some user commands here end test = Server.new while true do processCommand(STDIN.gets) end In the above sample, the thread dies on server.accept

    Read the article

  • about getadrrinfo() C++?

    - by Isavel
    I'm reading this book called beej's guide to network programming and there's a part in the book were it provide a sample code which illustrate the use of getaddrinfo(); the book state that the code below "will print the IP addresses for whatever host you specify on the command line" - beej's guide to network programming. now I'm curious and want to try it out and run the code, but I guess the code was develop in UNIX environment and I'm using visual studio 2012 windows 7 OS, and most of the headers was not supported so I did a bit of research and find out that I need to include the winsock.h and ws2_32.lib for windows, for it to get working, fortunately everything compiled no errors, but when I run it using the debugger and put in 'www.google.com' as command argument I was disappointed that it did not print any ipaddress, the output that I got from the console is "getaddrinfo: E" what does the letter E mean? Do I need to configure something out of the debugger? Interestingly I left the command argument blank and the output changed to "usage: showip hostname" Any help would be appreciated. #ifdef _WIN32 #endif #include <sys/types.h> #include <winsock2.h> #include <ws2tcpip.h> #include <iostream> using namespace std; #include <stdio.h> #include <string.h> #include <sys/types.h> #include <winsock.h> #pragma comment(lib, "ws2_32.lib") int main(int argc, char *argv[]) { struct addrinfo hints, *res, *p; int status; char ipstr[INET6_ADDRSTRLEN]; if (argc != 2) { fprintf(stderr,"usage: showip hostname\n"); system("PAUSE"); return 1; } memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version hints.ai_socktype = SOCK_STREAM; if ((status = getaddrinfo(argv[1], NULL, &hints, &res)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(status)); system("PAUSE"); return 2; } printf("IP addresses for %s:\n\n", argv[1]); for(p = res;p != NULL; p = p->ai_next) { void *addr; char *ipver; // get the pointer to the address itself, // different fields in IPv4 and IPv6: if (p->ai_family == AF_INET) { // IPv4 struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; addr = &(ipv4->sin_addr); ipver = "IPv4"; } else { // IPv6 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; addr = &(ipv6->sin6_addr); ipver = "IPv6"; } // convert the IP to a string and print it: inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr); printf(" %s: %s\n", ipver, ipstr); } freeaddrinfo(res); // free the linked list system("PAUSE"); return 0; }

    Read the article

  • Sql server Stored Procedure

    - by user177883
    I m passing a variable to stored procedure, i want the proc to make a look up to another table and get the primary key of the table and insert that value to the table. Table A: pk_id int, user varchar Table B: userKey int When i invoke sp_howto, and pass user to it, i want to it to get the pk_id from table A and insert it to table B userKey. @res = select userKey from TableA where user=@user insert into tableB (userKey) values (@res) Does this work? and what if I have many keys I want to populate like this?

    Read the article

  • How to do hex8 encoding in c?

    - by Tech163
    I am trying to encode a string in hex8 using c. The script I have right now is: int hex8 (char str) { str = printf("%x", str); if(strlen(str) == 1) { return printf("%s", "0", str); } else { return str; } } In this function, I will need to add a 0 ahead of the string if the length is less than 1. I don't know why I'm getting: passing argument 1 of 'strlen' makes pointer from integer without a cast Does anyone know why?

    Read the article

  • Change Google Chrome’s Process model?

    - by mobius42
    See here: http://imgur.com/lKffI.png Does anyone know how to stop Chrome doing this? Chrome seems to group all tabs I open through the same page into one process. If I copy and paste the links individually into separate tabs, it creates new processes, but when I just middle click links, it groups them into one. I want to force Chrome to create a new process for every tab because when one page locks up, it freezes pretty much all the tabs I have open and if one of the tabs crashes, it takes the rest with it. You can apparently alter Chrome's process model to one called "--process-per-tab" which seems to be what I'm looking for, but when I try and open Chrome with this argument via the terminal, it doesn't work. It's likely I'm not using the correct command; what I tried was: /Applications/"Google Chrome.app"/Contents/MacOS/"Google Chrome" --process-per-tab I'm on OSX and using the latest dev build 5.0.396.0.

    Read the article

  • debug assertion fail

    - by Kolt
    I have a program that runs correctly if I start it manually. However, if I try to add a registry key to start it automatically during startup, I get this error: Debug assertion failed (str!=null) fprintf.c line:55 I tried to add Sleep(20000) before anything hapens, but same error. here`s the code: main() { FILE* filetowrite; filetowrite = fopen("textfile.txt", "a+"); writefunction(filetowrite); } int writefunction(FILE* filetowrite) { fprintf(filetowrite, "%s", "\n\n"); ... } I also tried with passing filename as char* and opening it in wrtiefunction(), but same error.

    Read the article

  • Is it possible to get the current request that is being served by node.js?

    - by user420504
    I am using express.js. I have a need to be able to log certain request data whenever someone tries to log a message. For this I would like to create a helper method like so function log_message(level, message){ winston.log(level, req.path + "" + message); } I would then use the method like so. exports.index = function(req, res){ log_message("info", "I'm here"); } Note that I am not passing the req object to the log_message function. I want that to be transparently done so that the log_message API user does not need to be aware of the common data that is being logged. Is there a way to achieve this with express.js/node.js. Is the request object available from a global variable of some sort?

    Read the article

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