Search Results

Search found 32453 results on 1299 pages for 'acts as list'.

Page 16/1299 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • List view and list adapters for displaying json

    - by Rahul Varma
    Hi, I am trying to display the text from json in a list view. I got help for retrieving the json text from the following... http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/comment-page-1/#comment-498.... But my problem is that i cant figure out how to display them in list view. I also want to get only some of the text from url(for example, alerttext and date). Can anyone help me in declaring the list adapter and list view in order to display the data in the way i want... Plzzzz...

    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

  • Add entry to list and remove first one in Python

    - by wagglewax
    I have a list of about 40 entries. And I frequently want to append an item to the start of the list (with id 0) and want to delete the last entry (with id 40) of the list. how do i do this the best? like: (example with 5 entries) [0] = "herp" [1] = "derp" [2] = "blah" [3] = "what" [4] = "da..." after adding "wuggah" and deleting last it should be like: [0] = "wuggah" [1] = "herp" [2] = "derp" [3] = "blah" [4] = "what" or appending one and deleting first. And I don't want to end up manually moving them one after another all of the entries to the next id.

    Read the article

  • right-to-left unordered list

    - by Crippletoe
    hi all, i am trying to make an unordered list to behave in different browsers. i have a 2 level list which i am trying to display horizontally in one line. on safari and firefox everything looks good. on IE (7) everything goes nuts for some reason, and only when i am trying to make the list go right-to-left. when i try displaying it left to right, all browsers behave. a simple example of what i was doing is here: http://www.g6pdrecords.com/svk/test.html the CSS is found in the . any ideas anyone? thanks

    Read the article

  • Linux disk usage analyser that acts like symlinks are real files

    - by Rory
    I am using git-annex, an extension to the DVCS git, which is designed for handling large files. It makes heavy use of symlinks. The actual large files are moved to the .git/annex directory and the original files are symlinked to there. I am running out of disk space, and need to clear up, and see what's using all my space. Usually I'd use a disk usage tool like ncdu, Baobab or Filelight. However they treat the symlink as essentially empty, and only count the file that it is pointing to as using any space. Which means when I use git-annex, it shows no space used in the main directories and lots of space used in the .git/annex directory. This is not helpful. Is there any (graphical or ncurses) based disk usage programme for linux (apt-get installable would be easie that is capable (through options or not) of counting a symlink as using up the space that the original file uses up? Many have options for different behaviour for hard links, so makes sense that some should h (I know counting symlinks as using space has flaws, like counting the space space twice, broken symlinks, etc. But that's OK for my purposes)

    Read the article

  • How to filter node list based on the contents of another node list

    - by ~otakuj462
    Hi, I'd like to use XSLT to filter a node list based on the contents of another node list. Specifically, I'd like to filter a node list such that elements with identical id attributes are eliminated from the resulting node list. Priority should be given to one of the two node lists. The way I originally imagined implementing this was to do something like this: <xsl:variable name="filteredList1" select="$list1[not($list2[@id_from_list1 = @id_from_list2])]"/> The problem is that the context node changes in the predicate for $list2, so I don't have access to attribute @id_from_list1. Due to these scoping constraints, it's not clear to me how I would be able to refer to an attribute from the outer node list using nested predicates in this fashion. To get around the issue of the context node, I've tried to create a solution involving a for-each loop, like the following: <xsl:variable name="filteredList1"> <xsl:for-each select="$list1"> <xsl:variable name="id_from_list1" select="@id_from_list1"/> <xsl:if test="not($list2[@id_from_list2 = $id_from_list1])"> <xsl:copy-of select="."/> </xsl:if> </xsl:for-each> </xsl:variable> But this doesn't work correctly. It's also not clear to me how it fails... Using the above technique, filteredList1 has a length of 1, but appears to be empty. It's strange behaviour, and anyhow, I feel there must be a more elegant approach. I'd appreciate any guidance anyone can offer. Thanks.

    Read the article

  • List of functions references

    - by Ockonal
    Hello, I'm using boost::function for making references to the functions. Can I make a list of references? For example: boost::function<bool (Entity &handle)> behaviorRef; And I need in a list of such pointers. For example: std::vector<behaviorRef> listPointers; Of course it's wrong code due to behaviorRef isn't a type. So the question is: how can I store a list of pointers for the function?

    Read the article

  • Remote Software Solution that Acts as a Client

    - by Richard
    I am looking for something that I am not sure exists. I have a remote computer that will not allow incoming traffic due to ISP blocking of ports(basically double NAT situation that I am unable to get around). I am wondering if I have a computer acting as a client, is there any solution out there that will allow remote access to the computer. I do have other servers on the net that have static IP's that the computer could initiate a connection with. I am thinking of using Debian Linux, However computer is not built yet so OS is not overly important at this point.

    Read the article

  • linux shell utils: convert a list of hex to list of decimals

    - by osgx
    Hello How can I convert a file with a lot hex numbers into the decimal? Example: file1 0x59999 0x5acdc 0xffeff I want to start $ cat file1 | util | cat file2 and get file2 with smth like 1021489 1249230 3458080 (numbers in example output are random, as I cant convert so long hex to dec) Upd: perl : perl -pe '$_=hex;$_.="\n"'. Can anybody do it better? The real task is a sorting of hex numbers.

    Read the article

  • List of items with same values

    - by user559780
    I'm creating a list of items from a file BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("H:/temp/data.csv"))); try { List<Item> items = new ArrayList<Item>(); Item item = new Item(); String line = null; while ((line = reader.readLine()) != null) { String[] split = line.split(","); item.name = split[0]; item.quantity = Integer.valueOf(split[1]); item.price = Double.valueOf(split[2]); item.total = item.quantity * item.price; items.add(item); } for (Item item2 : items) { System.out.println("Item: " + item2.name); } } catch (IOException e) { reader.close(); e.printStackTrace(); } Problem is the list is displaying the last line in the file as the value for all items.

    Read the article

  • Method not returning string value c# <List>

    - by Santii20
    public List<string> Test_IsDataLoaded() { try { if (GRIDTest.Rows.Count != 0) { int countvalue = GRIDTest.Rows.Count; GRIDTest.Rows[0].WaitForControlReady(); List<string> ReleaseIDList = new List<string>(); int nCellCount = GRIDTest.Cells.Count; for(int nCount = 0;nCount<nCellCount ;nCount++) { if(nCount %5==0) ReleaseIDList.Add((GRIDTest.Cells[0].GetProperty("Value").ToString())); } return ReleaseIDList; } } catch (Exception) { } } Method throws me error = Not all code path return a value. Whats wrong in code.

    Read the article

  • Help with python list-comprehension

    - by leChuck
    A simplified version of my problem: I have a list comprehension that i use to set bitflags on a two dimensional list so: s = FLAG1 | FLAG2 | FLAG3 [[c.set_state(s) for c in row] for row in self.__map] All set_state does is: self.state |= f This works fine but I have to have this function "set_state" in every cell in __map. Every cell in __map has a .state so what I'm trying to do is something like: [[c.state |= s for c in row] for row in self.map] or map(lambda c: c.state |= s, [c for c in row for row in self.__map]) Except that neither works (Syntax error). Perhaps I'm barking up the wrong tree with map/lamda but I would like to get rid on set_state. And perhaps know why assignment does not work in the list-comprehension

    Read the article

  • PHP list of specific files in a directory

    - by Jessica
    The following code will list all the file in a directy <?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $thelist .= '<LI><a href="'.$file.'">'.$file.'</a>'; } } closedir($handle); } ?> <P>List of files:</p> <UL> <P><?=$thelist?></p> </UL> While this is very simple code it does it job. I'm now looking for a way to list ONLY file that have .xml (or .XML) at the end, how do I do that? Code is appreciate, thanks! jess

    Read the article

  • Sorting a meta-list by first element of children lists in Python

    - by thismachinechills
    I have a list, root, of lists, root[child0], root[child1], etc. I want to sort the children of the root list by the first value in the child list, root[child0][0], which is an int. Example: import random children = 10 root = [[random.randint(0, children), "some value"] for child in children] I want to sort root from greatest to least by the first element of each of it's children. I've taken a look at some previous entries that used sorted() and a lamda function I'm entirely unfamiliar with, so I'm unsure of how to apply that to my problem. Appreciate any direction that can by given Thanks

    Read the article

  • c# list<int> how to insert a new value in between two values

    - by gdubs
    so i have a list where i need to add new values constantly but when i do i need to increment it and insert it in between two values. List<int> initializers = new List <int>(); initializers.Add(1); initializers.Add(3); so initializers would have 1, 3 values. i would then process a new set of numbers. the initializers will need to have the values. 1, 5, 3, 7 and if i process another set of numbers it should become 1, 9, 5, 13, 3, 11, 7, 15 i know how to properly generate the new values inserted, i just need some help on inserting it in between the existing values of the initializers without having to add 2 or 3 more loops to move the values' positions.

    Read the article

  • Count number of given object in a list with LINQ

    - by Aaginor
    I have a list which can contain multiple occurrences of the same object. Now I need to count, how often the given object is contained in this list. int count = 0; foreach (IMyObject item in myList) if (item == object2Count) count++; I am sure that this can be done nicer with LINQ, but LINQ is still a mystery to me. My first question is: How would I count the objects via LINQ and the second question: Will this LINQ version be slower or faster? I am using a ObservableCollection and the number of items in the list is usally rather small ... usally not more then 20. Thanks in advance, Frank

    Read the article

  • How to know if a std::list has been modified

    - by Nick
    I have this class: class C { public: C* parent; std::list<C> children; }; I can use this class in this way for example: C root; C child; root.children.push_back(child); // or other method of std::list (es: push_front, insert, ...) // Here child.parent is root // How can I set the parent of child? I want to do this work internally to my class without losing the functionality of std::list, is it possible?

    Read the article

  • Building a linked list with LINQ

    - by FreshCode
    What is the fastest way to order an unordered list of elements by predecessor (or parent) element index using LINQ? Each element has a unique ID and the ID of that element's predecessor (or parent) element, from which a linked list can be built to represent an ordered state. Example ID | Predecessor's ID --------|-------------------- 20 | 81 81 | NULL 65 | 12 12 | 20 120 | 65 The sorted order is {81, 20, 12, 65, 120}. An (ordered) linked list can easily be assembled iteratively from these elements, but can it be done in fewer LINQ statements? Edit: I should have specified that IDs are not necessarily sequential. I chose 1 to 5 for simplicity. See updated element indices which are random.

    Read the article

  • How to display List<> using ListView?

    - by eriX
    When I use ListView to display a array of my object, I can use the following code: MyObject[] myObject; ... ArrayAdapter<MyObject> itemList = new ArrayAdapter<MyObject>(this, R.layout.list, myObject); setListAdapter(itemList); In case that the input is a list: List<MyObject> myobject; How can I assign it to ListAdapter? Please advise, Thx!

    Read the article

  • Remove duplicates in a String [] list f#

    - by Jose Maria de la Torre
    I need some noob help... I have a String[] list (a list that each element is a Array of strings) I wish to remove all duplicates in the list. But to see if they are duplicates I need to see the fist element in the array. what I have tried is let NotDuplicated = Duplicated.[0] |> Seq.distinct let NotDuplicated = Duplicated |> Seq.distinctBy id but nothing is working... can you guys please help me.. thanks!!

    Read the article

  • Sort a list numerically in Python

    - by Matthew
    So I have this list, we'll call it listA. I'm trying to get the [3] item in each list e.g. ['5.01','5.88','2.10','9.45','17.58','2.76'] in sorted order. So the end result would start the entire list over again with Santa at the top. Does that make any sense? [['John Doe', u'25.78', u'20.77', '5.01'], ['Jane Doe', u'21.08', u'15.20', '5.88'], ['James Bond', u'20.57', u'18.47', '2.10'], ['Michael Jordan', u'28.50', u'19.05', '9.45'], ['Santa', u'31.13', u'13.55', '17.58'], ['Easter Bunny', u'17.20', u'14.44', '2.76']]

    Read the article

  • Order a List (C#) by many fields?

    - by Esabe
    Hi everyone, I want to order a List of objects in C# by many fields, not just by one. For example, let's suppose I have a class called X with two Attributes, A and B, and I have the following objects, in that order: object1 = A = "a", B = "h" object2 = A = "a", B = "c" object3 = A = "b", B = "x" object4 = A = "b", B = "b" and I want to order the list by A attribute first, and when they are equals, by B element, so the order would be: "a" "c" "a" "h" "b" "b" "b" "x" As far as I know, the OrderBy method order by one parameter. Question: How can I order a C# List by more than one field? Thank you very much

    Read the article

  • Scolling list with jQuery

    - by Chris
    My javascript is not up to scratch at the moment and I am stumped with this! I need to create an animated list with javascript like this one - http://www.fiveminuteargument.com/blog/scrolling-list. What I want is to take a list like so <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> <li>Item 6</li> </ul> And display two at once, then display them in a loop, 2 at a time. Even pseudo code would help to get me started.

    Read the article

  • Find an element in List of List, c#

    - by Sandy
    Hi, I have a list of lists as below: List<List <T> > userList Class T { string uniqueidentifier, string param2, int param2} I have a uniqueidentifier and i need to find the element T in the list that has the same 'uniqueidentifier' value. I can do it using two 'foreach' loops. This does not seem to be nice way doing things. I guess there should be some inbuilt method like 'Find' that does the same thing and is highly optimized.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >