JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Rao
Mar 7, 2019 09:58
@Neil sorry for creating confusion, initial collection
[
  { "cards": { "item": [{ "key1": "val1" }] } },
  { "cards": { "item": [{ "k": "v" }] } }
]
final collection
[
  { "cards": { "item": { "key1": "val1" } } },
  { "cards": { "item": { "k": "v" } } }
]
Rao
Mar 7, 2019 09:47
right, is there a way to just iterate over and fix the structure without having to call a function?
Rao
Mar 7, 2019 09:42
it will hold just one item, it shouldn't have been a array in the first place and therefore I am trying to fix it by looping over the collection
Rao
Mar 7, 2019 09:41
example: initial collection: [{"cards": {"item": [{"first": "first"}]}},{"cards": {"item": [{"first": "first"}]}}]  final collection: [{"cards": {"item": {"key1": "val1"}}},{"cards": {"item": {"k": "v"}}}]
Rao
Mar 7, 2019 09:38
hope that clarifies
Rao
Mar 7, 2019 09:38
ok, so basically the item inside cards is an array containing one item and I wanted to pick that item and put it against cards.item
Rao
Mar 7, 2019 09:22
I am trying to rewrite the structure of my collections like below
      for (var [i, c] in collections) {
        collections[i].cards.item = c.cards.item[0]
      }
I can't seem to make it work.
Rao
Jul 22, 2015 07:55
cool, thanks guys! @Meredith @JanDvorak
Rao
Jul 22, 2015 07:53
yep
Rao
Jul 22, 2015 07:53
so there is no easier way?
Rao
Jul 22, 2015 07:51
@JanDvorak This might work, but it becomes very difficult to make changes to these values on the fly
Rao
Jul 22, 2015 07:50
@Meredith How? I'm also using jQuery, is there a way to collect them in jQuery?
Rao
Jul 22, 2015 07:48
@Meredith It wont work, cant use wildcard on attribute name itself.
Rao
Jul 22, 2015 07:45
Is there a way to collect all my "data-param-<something>" from an element? Ex: My element has <div data-param-name="a" data-param-age="67" data-param-place="xyz"></div>
 

[iOS][Android][ChaosOverFlow]

Join to become part of the community, not to simply ask questi...
Rao
Jan 21, 2018 11:26
@DilipTiwari Do think there is a better way of implementing this? stackoverflow.com/questions/48365626/…
Rao
Jan 21, 2018 10:01
I have a simple UITableView instance with section header set to a custom view, I am trying to change this header view to a different view whenever the header becomes sticky.
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Rao
Oct 18, 2015 16:40
Anyone here who is familiar with Laravel 5? I am writing a RESTful API system, need to clear few things.
Rao
Mar 16, 2015 17:55
@Danack Cool, thanks!
Rao
Mar 16, 2015 17:15
Simply put, when do I start polling for upload progress once the multipart form is submitted?
 

NSChat

Rules → spiff.io/nschat.rules —  Discussion for iOS and OS X ...
Rao
Oct 5, 2015 15:02
I will look for a tutorial now
Rao
Oct 5, 2015 15:02
anyways thanks!
Rao
Oct 5, 2015 15:01
and most of the tutorials online are in obj c
Rao
Oct 5, 2015 15:01
and search for a swift version
Rao
Oct 5, 2015 15:01
but still if the tutorial is in obj c, I just tend to close it
Rao
Oct 5, 2015 15:00
yea I have observed
Rao
Oct 5, 2015 14:59
and I have never coded in Obj C before
Rao
Oct 5, 2015 14:59
2.1
Rao
Oct 5, 2015 14:59
yes
Rao
Oct 5, 2015 14:56
nope
Rao
Oct 5, 2015 14:55
yeah, first time coding an app!
Rao
Oct 5, 2015 14:55
ok
Rao
Oct 5, 2015 14:54
now how do I populate my table?
Rao
Oct 5, 2015 14:54
ok, but the problem is if my dict is like this, [21 : "Apple", 42 : "Swimming", 53 : "Training", 64 : "Green"]
Rao
Oct 5, 2015 14:51
so since dict is not an ordered list, I am not able to make it work
Rao
Oct 5, 2015 14:50
no, I want to use sections
Rao
Oct 5, 2015 14:49
@Orion if my self.items were an array, this would work perfectly, self.items[indexPath.section]
Rao
Oct 5, 2015 14:35
This is my dictionary, self.items = [1 : "Apple", 2 : "Swimming", 3 : "Training", 4 : "Green"]
Rao
Oct 5, 2015 14:34
now in my cellForRowAtIndex how do I say, 'take first/second/third element from dictionary'?
Rao
Oct 5, 2015 14:33
I am trying to populate UITableView with data stored in a dictionary
 

Web Developers

Room to discuss javascript and jquery, php and mysql issues. b...
Rao
Jul 22, 2015 07:45
Is there a way to collect all my "data-param-<something>" from an element? Ex: My element has <div data-param-name="a" data-param-age="67" data-param-place="xyz"></div>
 

Java

Dedicated to the discussion of the Java programming language a...
Rao
Mar 16, 2015 21:46
What I want to do is, I want to store a list of strings under a char index.
Rao
Mar 16, 2015 21:39
@fge Can I have a hash map, new HashMap<Character, String[]>(); for this ?
Rao
Mar 16, 2015 20:50
so If the user inputs "elephant", I want to push it under array indexed 'e'
Rao
Mar 16, 2015 20:49
I just want them as index
Rao
Mar 16, 2015 20:43
so those strings will be the user input strings.
Rao
Mar 16, 2015 20:43
Oh, I am trying to collect user input and arrange them into appropriate array depending on their starting letter
Rao
Mar 16, 2015 20:32
I want an array containing an array of strings
Rao
Mar 16, 2015 20:30
could you pls explain what I need to do to achieve this
Rao
Mar 16, 2015 20:29
@fge You got me, I have 2years of exp in php and I am trying to learn Java now.
Rao
Mar 16, 2015 20:28
I want to construct an array containing array of strings, something like, ["A" => ["aa", "ab"], "B" => ["ba","bb"], ... ] and I want to know how to push to say "A"'s array