Search Results

Search found 47805 results on 1913 pages for 'return address'.

Page 91/1913 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • Return Count from Netflix oData Service When the LINQ Count() Method Doesn't Work

    - by Craig Shoemaker
    Is there a way to use a LINQ expression to request a Count query from the Netflix oData service? The Netflix documentation shows that you can return counts by appending $count to a request for a collection, but a URL like this: http://netflix.cloudapp.net/Catalog/Genres/$count Is not generated from an expression like this: var count = (from g in catalog.Genres select g).Count(); The above code returns an error saying that the Count method is not supported. Is there a way to do this in LINQ, or do I just need to make WebClient request to get the value?

    Read the article

  • TableAdapter to return ONLY selected columns? (VS2008)

    - by MattSlay
    (VS2008) I'm trying to configure a TableAdapter in a Typed DataSet to return only a certain subset of columns from the main schema of the table on which it is based, but it always returns the entire schema (all columns) with blank values in the columns I have omitted. The TableAdpater has the default Fill and GetData() methods that come from the wizard, which contain every column in the table, which is fine. I then added a new parameterized query method called GetActiveJobsByCustNo(CustNo), and I only included a few columns in the SQL query that I actually want to be in this table view. But, again, it returns all the columns in the master table schema, with empty values for the columns I omitted. The reason I am wanting this, is so I can just get a few columns back to use that table view with AutoGenerateColumns in an ASP.NET GridView. With it giving me back EVERY column i nthe schema, my presentation GridView contains way more columns that I want to show th user. And, I want to avoid have to declare the columns in the GridView.

    Read the article

  • Delphi Unicode String Type Stored Directly at its Address (or "Unicode ShortString")

    - by Andreas Rejbrand
    I want a string type that is Unicode and that stores the string directly at the adress of the variable, as is the case of the (Ansi-only) ShortString type. I mean, if I declare a S: ShortString and let S := 'My String', then, at @S, I will find the length of the string (as one byte, so the string cannot contain more than 255 characters) followed by the ANSI-encoded string itself. What I would like is a Unicode variant of this. That is, I want a string type such that, at @S, I will find a unsigned 32-bit integer (or a single byte would be enough, actually) containing the length of the string in bytes (or in characters, which is half the number of bytes) followed by the Unicode representation of the string. I have tried WideString, UnicodeString, and RawByteString, but they all appear only to store an adress at @S, and the actual string somewhere else (I guess this has do do with reference counting and such). Update: The most important reason for this is probably that it would be very problematic if sizeof(string) were variable. I suspect that there is no built-in type to use, and that I have to come up with my own way of storing text the way I want (which actually is fun). Am I right? Update I will, among other things, need to use these strings in packed records. I also need manually to read/write these strings to files/the heap. I could live with fixed-size strings, such as <= 128 characters, and I could redesign the problem so it will work with null-terminated strings. But PChar will not work, for sizeof(PChar) = 1 - it's merely an address. The approach I eventually settled for was to use a static array of bytes. I will post my implementation as a solution later today.

    Read the article

  • Removing stopwords,but should return as a line

    - by Sarath R Nair
    My question may appear silly. But as I am a rookie in Python , help me out. I have to pass a line to a stopword removal function. It works fine. But my problem is return of the function is appending the words. I want it as like follows: line = " I am feeling good , but I cant talk" Let "I,but,cant" are stopwords. After passing to the function , my output should be as "am feeling good , talk". What I a getting now is [['am','feeling','good','talk']]. Help me.

    Read the article

  • replace all link href's with return of a function, with regex

    - by Rajat Singhal
    I have a function which returns a modified url, if passed a url.. I need to call this function on hrefs of all the links in my html data.. I can't use DomDocument, it's in php cli, I need regex solution.. I have tried preg_replace, and preg_replace_callback, but I simply don't understand the whole concept of using $1, $2 in the replacement string..If somebody can point to a good documentation,that'll be great too.. function modifyUrl($old_url) { ...... return $new_url; } $html = "...";//Long html content having links //need to call modifyUrl for all link's hrefs..

    Read the article

  • Segmentation fault on writing char to char* address

    - by Lukas Dojcak
    hi guys, i've got problem with my little C program. Maybe you could help me. char* shiftujVzorku(char* text, char* pattern, int offset){ char* pom = text; int size = 0; int index = 0; while(*(text + size) != '\0'){ size++; } while(*(pom + index) != '\0'){ if(overVzorku(pom + index, pattern)){ while(*pattern != '\0'){ //vyment *pom s *pom + offset if(pom + index + offset < text + size){ char x = *(pom + index + offset); char y = *(pom + index); int adresa = *(pom + index + offset); *(pom + index + offset) = y; <<<<<< SEGMENTATION FAULT *(pom + index) = x; //*pom = *pom - *(pom + offset); //*(pom + offset) = *(pom + offset) + *pom; //*pom = *(pom + offset) - *pom; } else{ *pom = *pom - *(pom + offset - size); *(pom + offset - size) = *(pom + offset - size) + *pom; *pom = *(pom + offset - size) - *pom; } pattern++; } break; } index++; } return text; } Isn't important what's the programm doing. Mayby there's lot of bugs. But, why do I get SEGMENTATION FAULT (for destination see code) at this line? I'm, trying to write some char value to memory space, with help of address "pom + offset + index". Thanks for everything helpful. :)

    Read the article

  • SQL to return dates that fall in period and range

    - by Nate
    Hey stackers, I’ve been grinding my head on this for a while… My goal is to return all dates that fall between a start and end date and have a certain period as a factor, from the start date. (hard to explain) For example… Start Date: Nov 20, 1987; End Date: Jan 01, 1988; Period: 10 days; I want these dates: Nov 20, 1987; Nov 30, 1987; Dec 10, 1987; Dec 20, 1987; Dec 30, 1987; I already have a date table with all dates from 1900 to 2099. The period could be by days, months or years. Any ideas? Let me know if you need more info.

    Read the article

  • Query to return internal details about stored function in SQL Server database

    - by Anthony
    I have been given access to a SQL Server database that is currently used by 3rd party app. As such, I don't have any documentation on how that application stores the data or how it retrieves it. I can figure a few things out based on the names of various tables and the parameters that the user-defined functions takes and returns, but I'm still getting errors at every other turn. I was thinking that it would be really helpful if I could see what the stored functions were doing with the parameters given to return the output. Right now all I've been able to figure out is how to query for the input parameters and the output columns. Is there any built-in information_schema table that will expose what the function is doing between input and output?

    Read the article

  • GetProperties() to return all properties for an interface inheritance hierarchy

    - by sduplooy
    Assuming the following hypothetical inheritance hierarchy: public interface IA { int ID { get; set; } } public interface IB : IA { string Name { get; set; } } Using reflection and making the following call: typeof(IB).GetProperties(BindingFlags.Public | BindingFlags.Instance) will only yield the properties of interface IB, which is "Name". If we were to do a similar test on the following code, public abstract class A { public int ID { get; set; } } public class B : A { public string Name { get; set; } } the call typeof(B).GetProperties(BindingFlags.Public | BindingFlags.Instance) will return an array of PropertyInfo objects for "ID" and "Name". Is there an easy way to find all the properties in the inheritance hierarchy for interfaces as in the first example?

    Read the article

  • predicate subquery to return items by matching tags

    - by user3411663
    I have a many-to-many relationship between two entities; Item and Tag. I'm trying to create a predicate to take the selectedItem and return a ranking of items based on how many similar tags they have. So far I've tried: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SUBQUERY(itemToTag, $item, $item in %@).@count > 0", selectedItem.itemToTag]; Any other iterations that have failed. It currently only returns the selectedItem in the list. I've found little on Subquery. Is there a guru out there that can help me refine this? Thanks in advance for the help!

    Read the article

  • Using NSURLRequest+NSURLConnection seems overkill for a webcall with no data return

    - by Spectravideo328
    All, This might seems very straightforward but I have already gone through the URL loading system program guide and the various NSURL.... classes and not found my answer. I am just trying to do a simple call from the app to a website to reserve a party spot: NSString *path=[NSString stringWithFormat:@"http://www.myparty123.com/ireservedURL.asp?Nickname=%@&Seat=%i&Email=%@&Currentparty=%i",john,5432,[email protected],6598]; NSURL* reservationURL =[NSURL URLWithString:path]; NSData *call= [NSData dataWithContentsOfURL:reservationURL]; This seemed to be the simple way but I get this warning that I am not using the "call" variable. And it seems overkill to do a call using NSData where there is no data return. Yet, creating an NSURLRequest and initiating an NSURLConnection and then implementing delegates with that request seems to be overkill as well. What am I missing. Thanks KMB

    Read the article

  • Query to return internal details about stored function in MS-SQL database

    - by Anthony
    I have been given access to a ms-sql database that is currently used by 3rd party app. As such, I don't have any documentation on how that application stores the data or how it retrieves it. I can figure a few things out based on the names of various tables and the parameters that the user-defined functions takes and returns, but I'm still getting errors at every other turn. I was thinking that it would be really helpful if I could see what the stored functions were doing with the parameters given to return the output. Right now all I've been able to figure out is how to query for the input parameters and the output columns. Is there any built-in information_schema table that will expose what the function is doing between input and output?

    Read the article

  • adding DATE_SUB to query to return range of values in mysql

    - by ian
    Here is my original query: $query = mysql_query("SELECT s.*, UNIX_TIMESTAMP(`date`) AS `date`, f.userid as favoritehash FROM songs s LEFT JOIN favorites f ON f.favorite = s.id AND f.userid = '$userhash' ORDER BY s.date DESC"); This returns all the songs in my DB and then joins data from my favorites table so I can display wich items a return visitors has clicked as favorites or not. Visitors are recognized by a unique has storred in a cookie and in the favorites table. I need to alter this query so that I can get just the last months worth of songs. Below is my attempt at adding DATE_SUB to my query: $query = mysql_query("SELECT s.*, UNIX_TIMESTAMP(`date`) AS `date`, f.userid as favoritehash FROM songs s WHERE `date` >= DATE_SUB( NOW( ) , INTERVAL 1 MONTH ) LEFT JOIN favorites f ON f.favorite = s.id AND f.userid = '$userhash' ORDER BY s.date DESC"); Suggestions?

    Read the article

  • Return the name of the class instance with the highest 'someValue' instance variable

    - by Timbo
    I have a brand new Objective-C class called test. The test class has an instance variable called someValue, which contains an integer. I create 5 instances of the test class called aTest, bTest, cTest, dTest and eTest. The appropriate synthesize and property declarations for someValue are in place. Is there a clean way of returning the name of the class instance with the highest someValue value out of all the existing test class instances? The number of class instances may vary from the 5 in my example. Note I don't care what the value is, I just want to return the name of the class instance with the highest 'someValue' instance variable. I've tried a few NSMutable arrays however can only get the value not the name of the variable that contains it. Thanks in advance

    Read the article

  • PHP exec() and system() functions always return false in IIS

    - by Loftx
    Hi there, I'm trying to use the PHP exec() or system() (or any other similar function) to run a batch file, but I can't seem to get these to return anything. The simplest example I've seen is this, which outputs nothing: <?php echo system('dir'); ?> The script is running on a windows XP machine on IIS with PHP installed and I've also tried it on my shared hosting account running windows 2003 server/IIS. Can anyone suggest what I need to do to get this working, or provide any commands I can use for troubleshooting? Cheers, Tom

    Read the article

  • How to return JSON in a Webservice?

    - by BrunoLM
    I need a Hello World example... [WebService(Namespace = "xxxxx")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService()] public class Something : System.Web.Services.WebService { public Something() { } [WebMethod] [ScriptMethod(ResponseFormat=ResponseFormat.Json)] public string HelloWorld() { return "{Message:'hello world'}"; } } Because it generates an error {"Message":"Invalid JSON primitive: value.","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext context, JavaScriptSerializer serializer)\r\n at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"} What's wrong?

    Read the article

  • Synclock a section of code while waiting for ShowDialog to return

    - by clawson
    I'm having trouble working out how to lock my application out of a section of code while it waits for a response from an external program. I've used Synclock on a section of code with the Me object in the expression. In this Synclock I call an overridden ShowDialog method of a dialog box, which has a timeout parameter, but does return the value from the underlying ShowDialog function call ,once the timer is setup. Works like this. SyncLock Me Dim frmDlgWithTimeout As New frmDlgWithTimeout ' dialog box with overridden ShowDialog ' Dim res As DialogResult = frmDlgWithTimeout.ShowDialog(10 * 1000) ' 10 sec timeout ' End SyncLock Now, external programs may raise events that bring my application to this Synclock but it doesn't prevent it from entering it, even though the ShowDialog function hasn't returned a value (and hence what I thought would keep the section of code locked). There is only one instance of the object that is used for lock in the program. Your help is greatly appreciated.

    Read the article

  • c++ warning: address of local variable

    - by chnet
    int * ref () { int tmp = 100; return &tmp; } int main () { int * a = ref(); cout << *a << endl; } I know the function ref () is allocated stack space. It will get destroyed as soon as the function exits. So the complier will give warning information. But my question is why the returning result is still correct.

    Read the article

  • return a php associative array to javascript array

    - by Eric Sim
    I am trying to return a php associative array to javascript array through ajaxRequest.responseText Here's what I do. First in php, I do this: $encoded = json_encode($thisarray); echo $encoded; If I echo $encoded, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"} Then in js script, thisarray = new Array(); thisarray = ajaxRequest.responseText; If I alert thisarray, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"} That's wrong since alerting an array should give error. But in this case, when I alert thisarray, I get the full array!! Needless to say, I can't call my value out of thisarray, since it is yet defined as an array. Anyone can tell me what am I missing here?

    Read the article

  • MongoDB query to return only embedded document

    - by Matt
    assume that i have a BlogPost model with zero-to-many embedded Comment documents. can i query for and have MongoDB return only Comment objects matching my query spec? eg, db.blog_posts.find({"comment.submitter": "some_name"}) returns only a list of comments. edit: an example: import pymongo connection = pymongo.Connection() db = connection['dvds'] db['dvds'].insert({'title': "The Hitchhikers Guide to the Galaxy", 'episodes': [{'title': "Episode 1", 'desc': "..."}, {'title': "Episode 2", 'desc': "..."}, {'title': "Episode 3", 'desc': "..."}, {'title': "Episode 4", 'desc': "..."}, {'title': "Episode 5", 'desc': "..."}, {'title': "Episode 6", 'desc': "..."}]}) episode = db['dvds'].find_one({'episodes.title': "Episode 1"}, fields=['episodes']) in this example, episode is: {u'_id': ObjectId('...'), u'episodes': [{u'desc': u'...', u'title': u'Episode 1'}, {u'desc': u'...', u'title': u'Episode 2'}, {u'desc': u'...', u'title': u'Episode 3'}, {u'desc': u'...', u'title': u'Episode 4'}, {u'desc': u'...', u'title': u'Episode 5'}, {u'desc': u'...', u'title': u'Episode 6'}]} but i just want: {u'desc': u'...', u'title': u'Episode 1'}

    Read the article

  • sql server 2005 - return single row when 2 records in right table

    - by Peanut
    Hi, I have two related sql server tables ... TableA and TableB. ***TableA - Columns*** TableA_ID INT VALUE VARCHAR(100) ***TableB - Columns*** TableB_ID INT TableA_ID INT VALUE VARCHAR(100) For every single record in TableA there are always 2 records in TableB. Therefore TableA has a one-to-many relationship with TableB. How could I write a single sql statement to join these tables and return a single row for each row in TableA that includes: a column for the VALUE column in the first related row in table B a column for the VALUE column in the second related row in table B? Thanks.

    Read the article

  • how to return the current object?

    - by ajsie
    in code igniter you can type: $query = $this->db->query("YOUR QUERY"); foreach ($query->result() as $row) { echo $row->title; echo $row->name; echo $row->body; } i guess that the query method returns the object it's part of. am i correct? if i am, how do you type the line where it returns the object? so what i wonder is how it looks like inside the query method for the above code to be functional. public function query($sql) { // some db logic here with the $sql and saves the values to the properties (title, name and body) return X } with other words, what should X be?

    Read the article

  • Why is Window.open()'s return type void ?

    - by Salvin Francis
    Doing something like this is perfectly permissible in javascript: var newWindow = window.open(...) However, this does not work in the senario of GWT (I am using 1.5 I dont know about later versions), Window window = Window.open("", "", ""); Throws me a compile time error that the open is a method with a return type as void. Why should it be void ? What if i want to close my popup from the main Window ? how do I get its handle ? I will have to resort to native javascript no doubt but i was just curious so as to why this is so...

    Read the article

  • To return the list in JSON format

    - by Reshma
    Below is my code, List<string> modified_listofstrings = new List<string>(); string sJSON = ""; System.Web.Script.Serialization.JavaScriptSerializer jSearializer = new System.Web.Script.Serialization.JavaScriptSerializer(); resulted_value = final_resulted_series_name + ":" + period_name + ":" + period_final_value; modified_listofstrings.Add(resulted_value); json_resultedvalue = JsonConvert.SerializeObject(resulted_value); modified_listofstrings.Add(json_resultedvalue); sJSON = jSearializer.Serialize(modified_listofstrings); return sJSON; But on following line , sJSON = jSearializer.Serialize(modified_listofstrings); I am getting an error as Cannot implicitly convert type string to system.collection.generic.list

    Read the article

  • Sqlite and Python -- return a dictionary using fetchone()?

    - by AndrewO
    I'm using sqlite3 in python 2.5. I've created a table that looks like this: create table votes ( bill text, senator_id text, vote text) I'm accessing it with something like this: v_cur.execute("select * from votes") row = v_cur.fetchone() bill = row[0] senator_id = row[1] vote = row[2] What I'd like to be able to do is have fetchone (or some other method) return a dictionary, rather than a list, so that I can refer to the field by name rather than position. For example: bill = row['bill'] senator_id = row['senator_id'] vote = row['vote'] I know you can do this with MySQL, but does anyone know how to do it with SQLite? Thanks!!!

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >