Search Results

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

Page 111/1913 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • Query to return substring from string in SQL Server

    - by Jowie
    I have a user defined function called Sync_CheckData under Scalar-valued functions in Microsoft SQL Server. What it actually does is to check the quantity of issued product and balance quantity are the same. If something is wrong, returns an ErrorStr nvarchar(255). Output Example: Balance Stock Error for Product ID : 4 From the above string, I want to get 4 so that later on I can SELECT the rows which is giving errors by using WHERE clause (WHERE Product_ID = 4). Which SQL function can I use to get the substring?

    Read the article

  • jQuery .find() doesn't return data in IE but does in Firefox and Chrome

    - by Steve Hiner
    I helped a friend out by doing a little web work for him. Part of what he needed was an easy way to change a couple pieces of text on his site. Rather than having him edit the HTML I decided to provide an XML file with the messages in it and I used jQuery to pull them out of the file and insert them into the page. It works great... In Firefox and Chrome, not so great in IE7. I was hoping one of you could tell me why. I did a fair but of googling but couldn't find what I'm looking for. Here's the XML: <?xml version="1.0" encoding="utf-8" ?> <messages> <message type="HeaderMessage"> This message is put up in the header area. </message> <message type="FooterMessage"> This message is put in the lower left cell. </message> </messages> And here's my jQuery call: <script type="text/javascript"> $(document).ready(function() { $.get('messages.xml', function(d) { //I have confirmed that it gets to here in IE //and it has the xml loaded. //alert(d); gives me a message box with the xml text in it //alert($(d).find('message')); gives me "[object Object]" //alert($(d).find('message')[0]); gives me "undefined" //alert($(d).find('message').Length); gives me "undefined" $(d).find('message').each(function() { //But it never gets to here in IE var $msg = $(this); var type = $msg.attr("type"); var message = $msg.text(); switch (type) { case "HeaderMessage": $("#HeaderMessageDiv").html(message); break; case "FooterMessage": $("#footermessagecell").html(message); break; default: } }); }); }); </script> Is there something I need to do differently in IE? Based on the message box with [object Object] I'm assumed that .find was working in IE but since I can't index into the array with [0] or check it's Length I'm guessing that means .find isn't returning any results. Any reason why that would work perfectly in Firefox and Chrome but fail in IE? I'm a total newbie with jQuery so I hope I haven't just done something stupid. That code above was scraped out of a forum and modified to suit my needs. Since jQuery is cross-platform I figured I wouldn't have to deal with this mess. Edit: I've found that if I load the page in Visual Studio 2008 and run it then it will work in IE. So it turns out it always works when run through the development web server. Now I'm thinking IE just doesn't like doing .find in XML loaded off of my local drive so maybe when this is on an actual web server it will work OK. I have confirmed that it works fine when browsed from a web server. Must be a peculiarity with IE. I'm guessing it's because the web server sets the mime type for the xml data file transfer and without that IE doesn't parse the xml correctly.

    Read the article

  • Return value in Visual Studio's Autos window

    - by Dave
    When I used to develop in C++, I remember that Visual Studio had an entry in its Autos window whenever returning from a function call. This entry would tell me what value was returned from that function. One might argue that if a function returns a value, then you should set a variable to that value, i.e. int i = GetRandomInt(); But as a contrived example, suppose I wanted to do this: CycleTushKicker( GetRandomInt()); Instead of stepping into CycleTushKicker to figure out how many lickings my kid gets, I'd just like to know the value as soon as I exit GetRandomInt. Is there a way to get this when using C#?

    Read the article

  • Return the Column Name for row with last non-null value "Ms Access 2007"

    - by bri1969
    I have a Table, which contains a list of league players. Each season, we record their Points per Dart. Their total PPD for that season is stored in other tables and extracted through other queries, which in turn are imported to the master table "Player History" at the end of the season for use as historical data. The current query retrieves each players PPD for each season they played, when they played last, and how many seasons played. The code for Last season Played has become too long and unstable to use. it was originally created, and split into two separate columns because a single SQL was to long. (LSP1) and LSP2) which work, but as I add seasons, Access does not like the length of code. In short, i need to find a more simple code that will look at each row, and look in that row for the last non null cell and report which column that last non null value is in. So if a player played seasons 30 & 31, but did not play 32..but did play 33, the Column with the code should be titled Last Season Played, and for that Player, it would state "33" in that cell, indicating that this player last played season "33" I will provide both tables and the query.. Please help

    Read the article

  • Session variables return completely after unsetting.

    - by RemiX
    I have a script that should log the user out of the site. It unsets all $_SESSION and $_COOKIE variables related to the login data of the user. But somehow, it seems impossible to log out. I checked the $_SESSION array at the end of the logout script, and at the beginning of each page. At the end of the logout script it says 'array()', but when I click the home button - or any link on the site - the full session data is back again and I don't know where it comes from. This is how I try to unset the session data: unset($_SESSION); unset($_COOKIE["usid"]); unset($_COOKIE["pw"]); unset($_COOKIE["adm"]); -- I don't know how to put it on different lines, but it's not that hard to read. Why do these data keep coming back?!

    Read the article

  • Java: How to return single char after string

    - by newSpringer
    I have a file directory which could look like either C:\projects\lab3\test\test.java or C:\projects\assignment3\test\test.java But the "lab3" or "assignment3" can appear anywhere in the directory, it is not a set directory What i want is to check to see if the directory either contains "lab" or "assignment" and get the number that follows. In this case "3" This is what i have so far if(directory.toLowerCase().contains("lab")){ } else if (directory.toLowerCase().contains("assignment")){ } but i do not know how to check for the char straight after the word?

    Read the article

  • Return more then One field from database SQLAlchemy

    - by David Neudorfer
    This line: used_emails = [row.email for row in db.execute(select([halo4.c.email], halo4.c.email!=''))] Returns: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]'] I use this to find a match: if recipient in used_emails: If it finds a match I need to pull another field (halo4.c.code) from the database in the same row. Any suggestions on how to do this?

    Read the article

  • How to access ASP.NET App Over a Network Using IP Address

    - by john doe
    My asp.net web app is hosted on this URL on my local machine: http://localhost:45433/ I want to access the same application from a different computer on the network. I tried replacing the localhost with my IP but it did not work. any ideas! UPDATE 1: Now, I am getting this error: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

    Read the article

  • assembly.GetTypes() does not return all types

    - by meta
    I try to lead the types from an .dll (which is also referenced in the executing project). I call: public static void LoadPlugin(string pluginFile) { Assembly assembly = Assembly.LoadFrom(pluginFile); foreach (Type type in assembly.GetTypes()) { // play with it } } It loads just a few of them: public partial class Mathematics : UserControl, IMathematics, IPortable and public partial class Welcome : UserControl but the next one, and some others, are ignored: public partial class Test : UserControl, ITest, IPortable They all stand in the same assembly, under the same namespace. The public static void LoadPlugin(string pluginFile) method is located in other assembly that is also referenced in the executing project. No exceptions are thrown. What could be the issues for not loading all the types? Any ideas?

    Read the article

  • Return value of a JQuery autocomplete using an array of objects as its source

    - by user2920430
    In a JQuery autocomplete which uses an array of objects as its source, can I display the label in the INPUT and later access the value? The default behavior is that the value is displayed in the INPUT after selection. In this case the values represent indexes to unique keys in rows in a table. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>autocomplete demo</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> </head> <body> <label for="autocomplete">Select a programming language: </label> <input id="autocomplete"> <script> $( "#autocomplete" ).autocomplete({ source: [ { label:"c++", value:1 }, { label: "java", value:2 }, { label: "javascript", value:3 } ] }); </script> </body> </html>

    Read the article

  • Using SQLAlchemy, how can I return a count with multiple columns

    - by Andy
    I am attempting to run a query like this: SELECT comment_type_id, name, count(comment_type_id) FROM comments, commenttypes WHERE comment_type_id=commenttypes.id GROUP BY comment_type_id Without the join between comments and commenttypes for the name column, I can do this using: session.query(Comment.comment_type_id,func.count(Comment.comment_type_id)).group_by(Comment.comment_type_id).all() However, if I try to do something like this, I get incorrect results: session.query(Comment.comment_type_id, Comment.comment_type, func.count(Comment.comment_type_id)).group_by(Comment.comment_type_id).all() I have two problems with the results: (1, False, 82920) (2, False, 588) (3, False, 4278) (4, False, 104370) Problems: The False is not correct The counts are wrong My expected results are: (1, 'Comment Type 1', 13820) (2, 'Comment Type 2', 98) (3, 'Comment Type 2', 713) (4, 'Comment Type 2', 17395) How can I adjust my command to pull the correct name value and the correct count?

    Read the article

  • Return node level of hierarchical xml

    - by Ryan
    In a treeview you can retrieve the level of an item. I am trying to accomplish the same thing with the given input being an object. The XML data I will use for this example would be something like the following <?xml version="1.0" encoding="utf-8" ?> <Testing> <Numbers> <Number val="1"> <Number val="1.1"> <Number val="1.1.1"> <Number val="1.1.2" /> <Number val="1.1.3" /> <Number val="1.1.4" /> </Number> </Number> <Number val="1.2" /> <Number val="1.3" /> <Number val="1.4" /> </Number> <Number val="2" /> <Number val="3" /> <Number val="4" /> </Numbers> <Numbers> <Number val="5" /> <Number val="6" /> <Number val="7" /> <Number val="8" /> </Numbers> </Testing> This one is kicking my butt!

    Read the article

  • IntentService android download and return file to Activity

    - by Andrew G
    I have a fairly tricky situation that I'm trying to determine the best design for. The basics are this: I'm designing a messaging system with a similar interface to email. When a user clicks a message that has an attachment, an activity is spawned that shows the text of that message along with a paper clip signaling that there is an additional attachment. At this point, I begin preloading the attachment so that when the user clicks on it - it loads more quickly. currently, when the user clicks the attachment, it prompts with a loading dialog until the download is complete at which point it loads a separate attachment viewer activity, passing in the bmp byte array. I don't ever want to save attachments to persistent storage. The difficulty I have is in supporting rotation as well as home button presses etc. The download is currently done with a thread and handler setup. Instead of this, I'd like the flow to be the following: User loads message as before, preloading begins of attachment as before (invisible to user). When the user clicks on the attachment link, the attachment viewer activity is spawned right away. If the download was done, the image is displayed. If not, a dialog is shown in THIS activity until it is done and can be displayed. Note that ideally the download never restarts or else I've wasted cycles on the preload. Obviously I need some persistent background process that is able to keep downloading and is able to call back to arbitrarily bonded Activities. It seems like the IntentService almost fits my needs as it does its work in a background thread and has the Service (non UI) lifecycle. However, will it work for my other needs? I notice that common implementations for what I want to do get a Messenger from the caller Activity so that a Message object can be sent back to a Handler in the caller's thread. This is all well and good but what happens in my case when the caller Activity is Stopped or Destroyed and the currently active Activity (the attachment viewer) is showing? Is there some way to dynamically bind a new Activity to a running IntentService so that I can send a Message back to the new Activity? The other question is on the Message object. Can I send arbitrarily large data back in this package? For instance, rather than send back that "The file was downloaded", I need to send back the byte array of the downloaded file itself since I never want to write it to disk (and yes this needs to be the case). Any advice on achieving the behavior I want is greatly appreciated. I've not been working with Android for that long and I often get confused with how to best handle asynchronous processes over the course of the Activity lifecycle especially when it comes to orientation changes and home button presses...

    Read the article

  • How can an SQL query return data from multiple tables

    - by Fluffeh
    I would like to know how to get data from multiple tables in my database, what types of methods are there to do this, what are joins and unions and how are they different from one another? When should I use each one compared to the others? I am planning to use this in my (for example - PHP) application, but don't want to run multiple queries against the database, what options do I have to get data from multiple tables in a single query? Note: I am writing this as I would like to be able to link to a well written guide on the numerous questions that I constantly come across in the PHP queue, so I can link to this for further detail when I post an answer. The answers cover off the following: Part 1 - Joins and Unions Part 2 - Subqueries Part 3 - Tricks and Efficient Code

    Read the article

  • The best way to return related data in a SQL statement

    - by Darvis Lombardo
    I have a question on the best method to get back to a piece of data that is in a related table on the other side of a many-to-many relationship table. My first method uses joins to get back to the data, but because there are multiple matching rows in the relationship table, I had to use a TOP 1 to get a single row result. My second method uses a subquery to get the data but this just doesn't feel right. So, my question is, which is the preferred method, or is there a better method? The script needed to create the test tables, insert data, and run the two queries is below. Thanks for your advice! Darvis -------------------------------------------------------------------------------------------- -- Create Tables -------------------------------------------------------------------------------------------- DECLARE @TableA TABLE ( [A_ID] [int] IDENTITY(1,1) NOT NULL, [Description] [varchar](50) NULL) DECLARE @TableB TABLE ( [B_ID] [int] IDENTITY(1,1) NOT NULL, [A_ID] [int] NOT NULL, [Description] [varchar](50) NOT NULL) DECLARE @TableC TABLE ( [C_ID] [int] IDENTITY(1,1) NOT NULL, [Description] [varchar](50) NOT NULL) DECLARE @TableB_C TABLE ( [B_ID] [int] NOT NULL, [C_ID] [int] NOT NULL) -------------------------------------------------------------------------------------------- -- Insert Test Data -------------------------------------------------------------------------------------------- INSERT INTO @TableA VALUES('A-One') INSERT INTO @TableA VALUES('A-Two') INSERT INTO @TableA VALUES('A-Three') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-One') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-Two') INSERT INTO @TableB (A_ID, Description) VALUES(1,'B-Three') INSERT INTO @TableB (A_ID, Description) VALUES(2,'B-Four') INSERT INTO @TableB (A_ID, Description) VALUES(2,'B-Five') INSERT INTO @TableB (A_ID, Description) VALUES(3,'B-Six') INSERT INTO @TableC VALUES('C-One') INSERT INTO @TableC VALUES('C-Two') INSERT INTO @TableC VALUES('C-Three') INSERT INTO @TableB_C (B_ID, C_ID) VALUES(1, 1) INSERT INTO @TableB_C (B_ID, C_ID) VALUES(2, 1) INSERT INTO @TableB_C (B_ID, C_ID) VALUES(3, 1) -------------------------------------------------------------------------------------------- -- Get result - method 1 -------------------------------------------------------------------------------------------- SELECT TOP 1 C.*, A.Description FROM @TableC C JOIN @TableB_C BC ON BC.C_ID = C.C_ID JOIN @TableB B ON B.B_ID = BC.B_ID JOIN @TableA A ON B.A_ID = A.A_ID WHERE C.C_ID = 1 -------------------------------------------------------------------------------------------- -- Get result - method 2 -------------------------------------------------------------------------------------------- SELECT C.*, (SELECT A.Description FROM @TableA A WHERE EXISTS (SELECT * FROM @TableB_C BC JOIN @TableB B ON B.B_ID = BC.B_ID WHERE BC.C_ID = C.C_ID AND B.A_ID = A.A_ID)) FROM @TableC C WHERE C.C_ID = 1

    Read the article

  • Waiting for DialogActivity to return before continuing executing of the main thread

    - by jax
    How would I force the current thread to wait until another has finished before continuing. In my program the user selects a MODE from an AlertDialog, I want to halt executing of the program before continuing as the mode holds important configuration for the gameplay. new AlertDialog.Builder(this) .setItems(R.array.game_modes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: setMode(TRAINING_MODE); case 1: setMode(QUIZ_MODE); default: setMode(TRAINING_MODE); break; } //continue loading the rest of onCreate(); contineOnCreate(); } }) .create().show(); If this is impossible can anyone give a possible solution?

    Read the article

  • Using "as" and expecting a null return

    - by DrLazer
    For example. Lets say we have a stackpanel on a form. Its full of both Grids and Labels. I want to loop through all the Grids and do some operation on them but leave the Lables intact. At the moment I am doing it this way. foreach(UIElement element in m_stacker.Children) { Grid block = element as Grid; if(block != null) { //apply changes here } } So i'm using the fact that "as" returns null if it cannot cast into the required type. Is this an ok thing to do or is there a better solution to this problem?

    Read the article

  • Return HTML from a user selection

    - by Cruinh
    I have the following, very simple html page... <html> <head> <script type="text/javascript"> function alertSelection() { var selection = window.getSelection(); var txt = selection.toString(); alert(txt); } </script> </head> <body> This is <span style="background-color:black;color:white">the</span> text. <div style="background-color:green;width:30px;height:30px;margin:30px" onmouseover="alertSelection()"> </body> </html> When I select the entire first line and mouseover the square, I get an alert with "This is the text.". How would I fix this so the the span tag or any other selected HTML isn't stripped out of the alert message?

    Read the article

  • Return color on hover

    - by alonblack
    Here i created 3 images that goes from color to grayscale and i want to show the color on hover what i'v done wrong? here is the fiddle link: http://jsfiddle.net/4tHWg/6/ css code: .box { float: left; position: relative; width: 14.285714286%; } .boxInner img { width: 100%; display: block; } .boxInner img:hover { -webkit-filter: grayscale(0%); } @-webkit-keyframes toGrayScale { to { -webkit-filter: grayscale(100%); } } .box:nth-child(1) img { -webkit-animation: toGrayScale 1s 0.5s forwards; } .box:nth-child(2) img { -webkit-animation: toGrayScale 2s 1s forwards; } .box:nth-child(3) img { -webkit-animation: toGrayScale 3s 1.5s forwards; }

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >