Search Results

Search found 7375 results on 295 pages for 'parameter'.

Page 19/295 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Sorting Custom Objects with Parameter in .NET?

    - by Jeffrey Kern
    Let's say I have a custom object of Foo Is there anyway I can sort through a list of these objects, like list<of foo>.sort() and also be able to sort this list with a passable parameter. which will influence the sort? list<of foo>.sort(pValue) I'm guessing I'll need to define two separate sorts, but I am not sure.

    Read the article

  • How can I pass a C++ member function to a C API as a parameter

    - by michael
    Hi, In my C++ program, I need to call this c API: GConn* gnet_conn_new (const gchar *hostname, gint port, GConnFunc func); where GConnFunc is defined as: void (*GConnFunc) (GConn *conn); My question is if I have a C++ class and have a member function like Class A { public: A(); void my_func (GConn* conn); } In my A::A() Constructor, how can I pass this-myfunc to gnet_conn_new as the GConnFunc parameter? Thank you.

    Read the article

  • Query parameter using JS framework ?

    - by Maxim Veksler
    Hi, I seem to not be able to find implementation from the common Ajax libraries (JQuery, mootools, prototypejs...) that would allow the operation of parsing the window.location.href for request parameter. I would expect something like: $P{"param1"} == "param1_value" Am I missing something? p.s. The web does contains implementation examples for such operations

    Read the article

  • ASP.Net MVC TimeSpan as action parameter?

    - by HeavyWave
    I am trying to use TimeSpan as a parameter type for an action in a controller, but the value is always now, so I presume it is not parsed correctly by MVC. The value that gets sent to it is "7:00 PM". Is it possible to make MVC support such format? I am using MVC 2.

    Read the article

  • Sorting Custom Objects with Parameter in VB.Net/C#

    - by Jeffrey Kern
    Let's say I have a custom object of Foo Is there anyway I can sort through a list of these objects, like list<of foo>.sort() and also be able to sort this list with a passable parameter. which will influence the sort? list<of foo>.sort(pValue) I'm guessing I'll need to define two separate sorts, but I am not sure. Thanks!

    Read the article

  • Function this parameter on onclick

    - by Jerome
    I've some html code generated in javascript like this cell.innerHTML = '<a href="#" class="sortheader" id="sortheader_'+i+'" '+ 'onclick="ts_resortTable(this, '+i+');return false;">' + txt+'<span class="sortarrow"></span></a>'; I'd like to call the function ts_resortTable() but independently of the onclick event how can i generate the "this" parameter of the function? I tried the DOM selector : $('sortheader_'+i) in jQuery and the getElementById('#sortheader_'+i) as well but it's not working

    Read the article

  • PHP URL GET parameters inside URL parameter

    - by user547794
    Hello, I am developing facebook/myspace content share buttons. The Facebook link takes you to a URL on my website, but I need to pass additional parameters to my URL along with the parameters passed to facebook. Here's my example: http://www.facebook.com/share.php?t=MyCompany&u=http://foobar.com/test7.php?Share=161&FbShare=Facebook28 Do I need to escape something inside the "u" parameter?

    Read the article

  • filling a form with parameter already selected using ajax

    - by kawtousse
    hi every one, My goal untill now is to fill a form with values from a table (html table). it is a kind of refreshing the form. so the user who wants to modify the html table through the form must prefill the form with values wich he already selected. I used the DOM to acces to each row and cell in the table and i used ajax to pass parameter to other jsp. but Iam confused what shall be the next step to fill the form.

    Read the article

  • How to pass the parameter to the function

    - by avaro
    Hi, I have stored procedure that takes input parameter of table type. procedure test( name samptable type); My table has the structure like table: samptable( name chracter varying; address text[]; ) So how shoul i pass the values to the function to fill the table.

    Read the article

  • this parameter modifier in C#?

    - by Ivan
    I'm curious about this code snippet: public static class XNAExtensions { /// <summary> /// Write a Point /// </summary> public static void Write(this NetOutgoingMessage message, Point value) { message.Write(value.X); message.Write(value.Y); } // ... }; What does the this keyword mean next to the parameter type? I can't seem to find any information about it anywhere, even in the C# specification.

    Read the article

  • Sorry, Parameter is not valid.

    - by maruthikumar
    Hello All, I'm exporting some data to PDF. The data contains one or more bitmaps. Unfortunately I'm getting the following error during the export. Sorry, Parameter is not valid. Source: at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Image original, Int32 width, Int32 height) Type: System.ArgumentException Any help will be highly appreciable. Regards, Maruthi Kumar

    Read the article

  • C++ Simple thread with parameter (no .net)

    - by Marc Vollmer
    I've searched the internet for a while now and found different solutions but then all don't really work or are to complicated for my use. I used C++ until 2 years ago so it might be a bit rusty :D I'm currently writing a program that posts data to an URL. It only posts the data nothing else. For posting the data I use curl, but it blocks the main thread and while the first post is still running there will be a second post that should start. In the end there are about 5-6 post operations running at the same time. Now I want to push the posting with curl into another thread. One thread per post. The thread should get a string parameter with the content what to push. I'm currently stuck on this. Tried the WINAPI for windows but that crashes on reading the parameter. (the second thread is still running in my example while the main thread ended (waiting on system("pause")). It would be nice to have a multi plattform solution, because it will run under windows and linux! Heres my current code: #define CURL_STATICLIB #include <curl/curl.h> #include <curl/easy.h> #include <cstdlib> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> #if defined(WIN32) #include <windows.h> #else //#include <pthread.h> #endif using namespace std; void post(string post) { // Function to post it to url CURL *curl; // curl object CURLcode res; // CURLcode object curl = curl_easy_init(); // init curl if(curl) { // is curl init curl_easy_setopt(curl, CURLOPT_URL, "http://10.8.27.101/api.aspx"); // set url string data = "api=" + post; // concat post data strings curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str()); // post data res = curl_easy_perform(curl); // execute curl_easy_cleanup(curl); // cleanup } else { cerr << "Failed to create curl handle!\n"; } } #if defined(WIN32) DWORD WINAPI thread(LPVOID data) { // WINAPI Thread string pData = *((string*)data); // convert LPVOID to string [THIS FAILES] post(pData); // post it with curl } #else // Linux version #endif void startThread(string data) { // FUnction to start the thread string pData = data; // some Test #if defined(WIN32) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)thread, &pData, 0, NULL); // Start a Windows thread with winapi #else // Linux version #endif } int main(int argc, char *argv[]) { // The post data to send string postData = "test1234567890"; startThread(postData); // Start the thread system("PAUSE"); // Dont close the console window return EXIT_SUCCESS; } Has anyone a suggestion? Thanks for the help!

    Read the article

  • How to use value from primary accessdatasource control as parameter in select query for secondary ac

    - by weedave
    Hi, I'm trying to display all orders placed and I have a primary accessdatasource control that has a select query to get the customer information and the orderID. I want to use the orderID value from this first query as a parameter for the secondary accessdatasource control that selects the product information of the products in the order. In plain english, I want to:- select product info from product table where orderID = ? (where ? is the orderID value from the first query) I have tried the <%#Eval("OrderID")% but I get a "server tag not well formed" error, but I do get results returned when I just type the order ID in, but obviously every result (order) just contains the same product info... <asp:Repeater ID="Repeater1" runat="server" DataSourceID="AccessDataSource1"> <ItemTemplate> <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/project.mdb" SelectCommand="SELECT orderDetails.OrderID, album.Artist, album.Album, album.Cost, album.ImageURL, orderDetails.Quantity, orderDetails.Total FROM (album INNER JOIN orderDetails ON album.AlbumID = orderDetails.AlbumID) WHERE (orderDetails.OrderID = ? )"> <SelectParameters> // Error is on this line <asp:Parameter Name="OrderID" DefaultValue="<%#Eval ("OrderID")%>" /> </SelectParameters> </asp:AccessDataSource> <div class="viewAllOrdersOrderArea"> <div class="viewAllOrdersOrderSummary"> <p><b>Order ID: </b><%#Eval("OrderID")%></p> <h4>Shipping Details</h4> <p><b>Shipping Address: </b><%#Eval("ShippingName")%>, <%#Eval("ShippingAddress")%>, <%#Eval("ShippingTown")%>, <%#Eval("ShippingPostcode")%></p> <h4>Payment Details</h4> <p><b>Cardholder's Address: </b><%#Eval("CardHolder")%>, <%#Eval("BillingAddress")%>, <%#Eval("BillingTown")%>, <%#Eval("BillingPostcode")%></p> <p><b>Payment Method: </b><%#Eval("CardType")%></p> <p><b>Card Number: </b><%#Eval("CardNumber")%></p> <p><b>Start Date: </b><%#Eval("StartDate")%>, Expiry Date: <%#Eval("ExpiryDate")%></p> <p><b>Security Digits: </b><%#Eval("SecurityDigits")%></p> <h4>Ordered items:</h4> <asp:Repeater ID="Repeater2" runat="server" DataSourceID="AccessDataSource2"> <ItemTemplate> <div style="display: block; float: left;"> <div class="viewAllOrdersProductImage"> <img width="70px" height="70px" alt="<%# Eval("Artist") %> - <%# Eval("Album") %>" src="assets/images/thumbs/<%# Eval("ImageURL") %>" /> </div> <div style="display:block; float:left; padding-top:15px; padding-right:20px;"><p><b><%# Eval("Artist") %> - <%# Eval("Album") %></b></p> <p>£<%# Eval("Cost") %> x <%# Eval("Quantity") %> = £<%#Eval("Total")%></p></div> </div> </ItemTemplate> </asp:Repeater> </div> </div> </ItemTemplate> </asp:Repeater>

    Read the article

  • Errors with parameter datatype in PostgreSql query

    - by John
    Im trying to execute a query to postgresql using the following code. It's written in C/C++ and I keep getting the following error when declaring a cursor: DECLARE CURSOR failed: ERROR: could not determine data type of parameter $1 Searching on here and on google, I can't find a solution. Can anyone find where I have made and error and why this is happening? thanks! void searchdb( PGconn *conn, char* name, char* offset ) { // Will hold the number of field in table int nFields; // Start a transaction block PGresult *res = PQexec(conn, "BEGIN"); if (PQresultStatus(res) != PGRES_COMMAND_OK) { printf("BEGIN command failed: %s", PQerrorMessage(conn)); PQclear(res); exit_nicely(conn); } // Clear result PQclear(res); printf("BEGIN command - OK\n"); //set the values to use const char *values[3] = {(char*)name, (char*)RESULTS_LIMIT, (char*)offset}; //calculate the lengths of each of the values int lengths[3] = {strlen((char*)name), sizeof(RESULTS_LIMIT), sizeof(offset)}; //state which parameters are binary int binary[3] = {0, 0, 1}; res = PQexecParams(conn, "DECLARE emprec CURSOR for SELECT name, id, 'Events' as source FROM events_basic WHERE name LIKE '$1::varchar%' UNION ALL " " SELECT name, fsq_id, 'Venues' as source FROM venues_cache WHERE name LIKE '$1::varchar%' UNION ALL " " SELECT name, geo_id, 'Cities' as source FROM static_cities WHERE name LIKE '$1::varchar%' OR FIND_IN_SET('$1::varchar%', alternate_names) != 0 LIMIT $2::int4 OFFSET $3::int4", 3, //number of parameters NULL, //ignore the Oid field values, //values to substitute $1 and $2 lengths, //the lengths, in bytes, of each of the parameter values binary, //whether the values are binary or not 0); //we want the result in text format // Fetch rows from table if (PQresultStatus(res) != PGRES_COMMAND_OK) { printf("DECLARE CURSOR failed: %s", PQerrorMessage(conn)); PQclear(res); exit_nicely(conn); } // Clear result PQclear(res); res = PQexec(conn, "FETCH ALL in emprec"); if (PQresultStatus(res) != PGRES_TUPLES_OK) { printf("FETCH ALL failed"); PQclear(res); exit_nicely(conn); } // Get the field name nFields = PQnfields(res); // Prepare the header with table field name printf("\nFetch record:"); printf("\n********************************************************************\n"); for (int i = 0; i < nFields; i++) printf("%-30s", PQfname(res, i)); printf("\n********************************************************************\n"); // Next, print out the record for each row for (int i = 0; i < PQntuples(res); i++) { for (int j = 0; j < nFields; j++) printf("%-30s", PQgetvalue(res, i, j)); printf("\n"); } PQclear(res); // Close the emprec res = PQexec(conn, "CLOSE emprec"); PQclear(res); // End the transaction res = PQexec(conn, "END"); // Clear result PQclear(res); }

    Read the article

  • Matching the superclass's constructor's parameter list, is treating a null default value as a non-null value within a constructor a violation of LSP?

    - by Panzercrisis
    I kind of ran into this when messing around with FlashPunk, and I'm going to use it as an example. Essentially the main sprite class is pretty much class Entity. Entity's constructor has four parameters, each with a default value. One of them is graphic, whose default value is null. Entity is designed to be inherited from, with many such subclasses providing their own graphic within their own internal workings. Normally these subclasses would not have graphic in their constructor's parameter lists, but would simply pick something internally and go with it. However I was looking into possibly still adhering to the Liskov Substitution Principal. Which led me to the following example: package com.blank.graphics { import net.flashpunk.*; import net.flashpunk.graphics.Image; public class SpaceGraphic extends Entity { [Embed(source = "../../../../../../assets/spaces/blank.png")] private const BLANK_SPACE:Class; public function SpaceGraphic(x:Number = 0, y:Number = 0, graphic:Graphic = null, mask:Mask = null) { super(x, y, graphic, mask); if (!graphic) { this.graphic = new Image(BLANK_SPACE); } } } } Alright, so now there's a parameter list in the constructor that perfectly matches the one in the super class's constructor. But if the default value for graphic is used, it'll exhibit two different behaviors, depending on whether you're using the subclass or the superclass. In the superclass, there won't be a graphic, but in the subclass, it'll choose the default graphic. Is this a violation of the Liskov Substitution Principal? Does the fact that subclasses are almost intended to use different parameter lists have any bearing on this? Would minimizing the parameter list violate it in a case like this? Thanks.

    Read the article

  • Add/remove Cake named URL parameter for a link

    - by sibidiba
    Using CakePHP 1.3 there are named parameters in the URL like .../name:value/... These are used for example by pagination links .../page:2/key:date/sort:desc/... How to generate links with HtmlHelper::link() adding/deleting such named parameters from the current URL? Basically I want create links to add/remove/modify the category:ID named parameter in the current URL. It must not touch the URL, anchor, other named parameters, GET parameters in the URL. Or how can I pass named parameters to HtmlHelper::link()?

    Read the article

  • Spring Web MVC: Use same request mapping for request parameter and path variable

    - by ngeek
    Good people: is there a way to express that my Spring Web MVC controller method should be matched either by a request handing in a ID as part of the URI path ... @RequestMapping(method=RequestMethod.GET, value="campaigns/{id}") public String getCampaignDetails(Model model, @PathVariable("id") Long id) { ... or if the client sends in the ID as a HTTP request parameter in the style ... @RequestMapping(method=RequestMethod.GET, value="campaigns") public String getCampaignDetails(Model model, @RequestParam("id") Long id) { This seems to me a quite common real-world URL scheme where I don't want to add duplicate code, but I wasn't able to find an answer yet. Any advice highly welcome.

    Read the article

  • CGBitmapContextCreate: unsupported parameter combination

    - by tarmes
    I'm getting this error when creating a bitmap context: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 24 bits/pixel; 3-component color space; kCGImageAlphaNone; 7936 bytes/row. Here's the code (note that the context is based on the parameters of an existing CGImage: context = CGBitmapContextCreate(NULL, (int)pi.bufferSizeRequired.width, (int)pi.bufferSizeRequired.height, CGImageGetBitsPerComponent(imageRef), 0, CGImageGetColorSpace(imageRef), CGImageGetBitmapInfo(imageRef)); Width is 2626, height is 3981. I've leaving bytesPerRow at zero so that it gets calculated automatically for me, and it's chosen 7936 of its own accord. So, where on Earth is the inconsistency? It's driving me nuts.

    Read the article

  • Java generics parameters with base of the generic parameter

    - by Iulian Serbanoiu
    Hello, I am wondering if there's an elegant solution for doing this in Java (besides the obvious one - of declaring a different/explicit function. Here is the code: private static HashMap<String, Integer> nameStringIndexMap = new HashMap<String, Integer>(); private static HashMap<Buffer, Integer> nameBufferIndexMap = new HashMap<Buffer, Integer>(); // and a function private static String newName(Object object, HashMap<Object, Integer> nameIndexMap){ .... } The problem is that I cannot pass nameStringIndexMap or nameBufferIndexMap parameters to the function. I don't have an idea about a more elegant solution beside doing another function which explicitly wants a HashMap<String, Integer> or HashMap<Buffer, Integer> parameter. My question is: Can this be made in a more elegant solution/using generics or something similar? Thank you, Iulian

    Read the article

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