Original URL: http://blog.csdn.net/trochiluses/article/details/9048539default value (:-)If the variable is followed by a colon and a minus sign, then the variable is followed by the default value of the variable.$ company=$ printf "%s/n" "${company:-unknown Company}"Unknown CompanyThe actual value of the variable can remain unchanged.Colons can also be omitted without:$ company=$ printf "%s/n" "${company-nightlight Inc"$Specify default value (: =)If t
C # Hill Sort
The hill sort is to insert the component segments into the sort.
using System; namespace ShellSorter { public class ShellSorter { public void Sort(int [] list) { int inc; for(inc=1;inc<=list.Length/9;inc=3*inc+1); for(;in
No, summarize the personal commonly used makefile template for later use.1. Compiling the dynamic library[Plain]View PlainCopy
#############################################################
# Makefile for Shared library.
# Compile the dynamic link library
#############################################################
#set Your own environment option
CC = g++
Cc_flag =-d_nomng-d_fileline
#set Your Inc and Lib
This article illustrates the method of Python's implementation of hill sorting algorithm. Share to everyone for your reference. Specifically as follows:
?
1 2 3 4 5 6 7 8 9 10 11 12 13-14
def shellsort (items): Inc = Len (items)/2 while Inc:for I-xrange (len (items)): j = I temp = items[i] while J >= Inc and Items[j-inc] > Temp:items[j] = items[
polymorphism, to help it achieve a bit.
Using System;
Namespace Shellsorter
{
public class Shellsorter
{
public void Sort (int [] list)
{
INT Inc;
For (inc=1;incfor (; inc>0;inc/=3)
{
for (int i=inc+1;i{
int t=list[i-1];
int j=i;
while ((J>
1. Pass value parameter (not pointer parameter):
#include int inc(int x); int main(void) { int num = 1; printf("%d\n",inc(num)); /* 2 */ printf("%d\n",num); /* 1; num 并没有改变,用作函数参数时只是复制过去 */ getchar(); return 0; } int inc(int x) { x++; return x; }
2. Address: Parameters are pointers, parameters are addresses
#include int
Reproduced1). Update ()CommandDb.collection.update (criteria, objnew, Upsert, Multi)Criteria:update query conditions, similar to those in the SQL update queryObjnew:update objects and some updated operators (such as $, $inc ... ) can also be understood as the SQL update query within the set after theUpsert: This parameter means that if there is no record of update, insert Objnew,true is inserted, default is False, not inserted.Multi:mongodb default is
name:liufang relational database in the where in the judgment condition, and post is relative to the SET statement after the execution content.The simplest thing to update is to use a new document instead of a matching document, which is suitable for a time when the pattern structure has changed significantly. As in the following document:{ "name":"tyq", "age":22, “date”:newDate()}Modified to:{ "name":"tyq", “age”:22, “friends”:”liufang”}Such as:modifierLet's talk about MongoDB's powe
random access to the data. The record can also be variable length. The index cannot be changed after it is set, but the entire record can be deleted.The linear dataset (Lds-linear data set), in effect, is a byte stream dataset, which is the only byte stream dataset format in traditional MVS. Many system functions for z/OS use this format, but it is rarely used by applications.Relative record dataset (Rrds-relative record Data set), a file format simi
-1.4.8 -- with-gmetadMakeMake install6, run./gmetad-d 3Error while loading shared libraries: librrd. so.4Ln-s/usr/local/rrdtool-1.4.8/lib/librrd. so.4/usr/local/lib/librrd. so.4Going to run as user nobody Please make sure that/var/lib/ganglia/rrds exists: No such file or directoryMkdir-p/var/lib/ganglia/rrdsChown nobody. nobody/var/lib/ganglia/rrds7, start cp gmetad/gmetad. init/etc/init. d/gmetadChkconfig -- add gmetadChkconfig -- list gmetadCp gmond
A ganglia monitoring is installed for Ceph, as follows. 1. Environmental statementCeph is the 3 physical machines installed on the centos6.5: Mon0, OSD1, OSD2, so you need to install Gmond on all three machines, OSD2 on Gmetad. 2. Installation processInstall the Epel source first: RPM-IVH http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmTo install a dependency package:Yum Install Apr-devel Expat-develInstall Gmond in Mon0 and OSD1:Yum Install ganglia ganglia-gmond
# This, the metrics could appear to come from any# interface and the DNS names associated with# those IPs would be used to create the rrds.#mcast_join = 239.2.11.71Host = HDP3 (practice proves that this can only be, not localhost)Port = 8649TTL = 1}/* You can specify as many udp_recv_channels as. */Udp_recv_channel {#mcast_join = 239.2.11.71Port = 8649#bind = 239.2.11.71#retry_bind = True# Size of the UDP buffer. If You is handling lots of metrics you
" host1 host2
Xml_port 8651
Interactive_port 8652
Rrd_rootdir "/var/lib/ganglia/rrds"
The Data_source parameter defines the cluster name and the nodes in the cluster. Because of the multicast mode, each Gmond node has all the monitoring data of the node machine in the Cluster1, so it is not necessary to write all the nodes into the data_source. The proposed write is no less than 2, when the host1 node freezes, will automatically find HOST2 node to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.