Messaged the first time getChildCount is messaged.  Creates
children with random names from names.
552995
protected void loadChildren()
    {
        DynamicTreeNode     newNode;
//        Font                font;
//        int                 randomIndex;

        NodeData dataParent = (NodeData)this.getUserObject();
        FieldList fieldList = dataParent.makeRecord();
        FieldTable fieldTable = fieldList.getTable();

        m_fNameCount = 0;
        try   {
            fieldTable.close();
//          while (fieldTable.hasNext())
            while (fieldTable.next() != null)
            {
                String objID = fieldList.getField(0).toString();
                String strDescription = fieldList.getField(3).toString();
                NodeData data = new NodeData(dataParent.getBaseApplet(), dataParent.getRemoteSession(), strDescription, objID, dataParent.getSubRecordClassName());
                newNode = new DynamicTreeNode(data);
                /** Don't use add() here, add calls insert(newNode, getChildCount())
                  so if you want to use add, just be sure to set hasLoaded = true first. */
                this.insert(newNode, (int)m_fNameCount);
                m_fNameCount++;
            }
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        /** This node has now been loaded, mark it so. */
        m_bHasLoaded = true;
    }
1082916
public void refreshNames() {
        Message namesMessage = new Message(MessageType.NAMES, this.channelName);
        List<Message> response;

        try {
            response = connection.request(
                MessageFilters.message(MessageType.RPL_NAMREPLY, null, "=", channelName),
                MessageFilters.message(MessageType.RPL_ENDOFNAMES, null, channelName),
                namesMessage);
        } catch (InterruptedException e) {
            return;
        }

        List<String> names = new ArrayList<String>();

        for (Message message : response) {
            if (message.getType() == MessageType.RPL_NAMREPLY) {
                String[] args = message.getArgs();

                for (String name : args[args.length - 1].split(" ")) {
                    names.add(name.replaceFirst("^[@+]", ""));
                }
            }
        }

        this.names = names;
    }
1074821
function child_by_name(parent, name) {
  var children = parent.children || [];
  for (var i = 0; i < children.length; i++) {
    if (children[i].name == name) return children[i];
  }
  return null;
}
562474
def listener(messages):
    
    for m in messages:
        if m.content_type == 'text':
            # print the sent message to the console
            print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text)
66266
def count_children(cls, resource_id, db_session=None, *args, **kwargs):
        
        query = db_session.query(cls.model.resource_id)
        query = query.filter(cls.model.parent_id == resource_id)
        return query.count()
1350762
function getChildElementCount(element) {
    if (element.children) {
      return element.children.length;
    }
    if (typeof element.childElementCount !== 'undefined') {
      return element.childElementCount;
    }
    var count = 0;
    for (var i = 0; i < element.childNodes.length; i++) {
      count += element.nodeType === 1 ? 1 : 0;
    }
    return count;
  }
869124
def statistics
      raise(ArgumentError, 'First call MessageConsumer::on_message with statistics: true before calling MessageConsumer::statistics()') unless @message_count
      duration = (@last_time || Time.now) - @start_time
      {
        messages:            @message_count,
        duration:            duration,
        messages_per_second: (@message_count/duration).to_i
      }
    end
639149
def inbox_count_for(user):
    
    return Message.objects.filter(recipient=user, read_at__isnull=True, recipient_deleted_at__isnull=True).count()
781043
function srandmember(count) {
  var list = []
    , rand
    , members = this._keys
    , len = this._keys.length;

  if(count === 0) return list;

  // no count, bulk string reply
  if(count === undefined) {
    return this.getRandomKey();
  // positive count
  }else if(count > 0) {
    count = Math.min(count, len);
    while(list.length < count) {
      rand = this.getRandomKey();
      /* istanbul ignore next: random, sometimes yes, sometimes no */
      if(!~ArrayIndex.indexOf(rand, list)) {
        list.push(rand);
      }
    }
  // negative value, duplicates are ok
  }else{
    count = Math.abs(count);
    while(list.length < count) {
      rand = this.getRandomKey();
      list.push(rand);
    }
  }
  return list;
}
1208273
def child_added(self, child):
        
        super(AndroidViewPager, self).child_added(child)
        self._notify_count += 1
        self.get_context().timed_call(
            self._notify_delay, self._notify_change)
564993
private void generateDN() {
        if (names.length == 1) {
            dn = names[0].toString();
            return;
        }

        StringBuilder sb = new StringBuilder(48);
        if (names != null) {
            for (int i = names.length - 1; i >= 0; i--) {
                if (i != names.length - 1) {
                    sb.append(", ");
                }
                sb.append(names[i].toString());
            }
        }
        dn = sb.toString();
    }
132494
private Chat createChat(Message message) {
        Jid from = message.getFrom();
        // According to RFC6120 8.1.2.1 4. messages without a 'from' attribute are valid, but they
        // are of no use in this case for ChatManager
        if (from == null) {
            return null;
        }

        EntityJid userJID = from.asEntityJidIfPossible();
        if (userJID == null) {
            LOGGER.warning("Message from JID without localpart: '" + message.toXML() + "'");
            return null;
        }
        String threadID = message.getThread();
        if (threadID == null) {
            threadID = nextID();
        }

        return createChat(userJID, threadID, false);
    }
1183024
public int getChildCount(Class<? extends ElementBase> clazz) {
        if (clazz == ElementBase.class) {
            return getChildCount();
        }
        
        int count = 0;
        
        for (ElementBase child : children) {
            if (clazz.isInstance(child)) {
                count++;
            }
        }
        
        return count;
    }
913637
function _addNewEntries(treeData, added) {
        added.forEach(function (filePath) {
            var isFolder = _.last(filePath) === "/";

            filePath = isFolder ? filePath.substr(0, filePath.length - 1) : filePath;

            var parentPath = FileUtils.getDirectoryPath(filePath),
                parentObjectPath = _filePathToObjectPath(treeData, parentPath),
                basename = FileUtils.getBaseName(filePath);

            if (parentObjectPath) {
                // Verify that the children are loaded
                var childrenPath = _.clone(parentObjectPath);
                childrenPath.push("children");
                if (treeData.getIn(childrenPath) === null) {
                    return;
                }

                treeData = _createPlaceholder(treeData, parentPath, basename, isFolder, {
                    notInCreateMode: true,
                    doNotOpen: true
                });
            }
        });

        return treeData;
    }
385170
public MessageRecordDesc createNewMessage(BaseMessage message, String strKey)
    {
        MessageRecordDesc messageData = null;
        String strClassName = this.getField(MessageInfo.MESSAGE_CLASS).toString();
        messageData = (MessageRecordDesc)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
        if (messageData != null)
               messageData.init(message, strKey);
        return messageData;
    }
236890
public int getChildCount()
    {
        if(!m_bHasLoaded)
        {
            NodeData data = (NodeData)this.getUserObject();
            if ((data == null) || (!data.isLeaf()))
                this.loadChildren();
        }
        return super.getChildCount();
    }
258074
public void addChild(LockedObject newChild) {
        if (_children == null) {
            _children = new LockedObject[0];
        }
        int size = _children.length;
        LockedObject[] newChildren = new LockedObject[size + 1];
        System.arraycopy(_children, 0, newChildren, 0, size);
        newChildren[size] = newChild;
        _children = newChildren;
    }