example, in Id2, its fatherid is id1.
In this way, we get the definition of the data table of the category catalog:
Create Table [catalog] (
[ID] [int] not null,
[Name] [nvarchar] (50) not null,
[Fatherid] [int] not null
);
Conventions: we agree to use-1 as the parent code for the top layer of classification. -1. This is a virtual classification. It is not recorded in the database.
How to restore a treeThe biggest advantage of the catalog definition above is that it can be used
]
Static Forum directory and sub-directory
Currently, websites generally use a flat tree-like mesh structure, that is, directory navigation.
Such as: http://www.cnblogs.com/daimage/archive/2012/02/25/2367534.html
How to use directory navigation in discuz?
1. Modify function_core.php under source \ Function
Find If ( $ Type = 'Forum _ forumdisplay '){ List (,,, $ FID , $ Page ,$ Extra ) = Func_get_args (); $ R = Array ('{
appropriately, while optimizing the output display
Contents
Initial setup
BER Simulation
Simulation results
Initial setupEmpty workspace, data, close all windows All All;Simulation parameter settings ebn0_db = 1;% ebn0_db ber range, vector;Frames_num = 1;% frames_num Maximum number of emulated frames;Max_iter_num = 30;% Max_iter_num algorithm maximum number of iterations;Max_error_frame = 200;% Max_error_frame Simulation Maximum number of error frames;Biterror = Ze
The infinite classification is a kind of data structure often used in the actual development, we call it the tree structure generally.
title: Similar to Taobao commodity classification, you can set its subclasses in any category.
First, create ' type ' datasheet' ID ' from growth
' FID ' int (11) default (0), parent Node ID
' Name ' varchar (50), category name
Copy Code code as follows:
CREATE TABLE ' type ' (
' id ' int (one) not
to display the next level of a category. We know that the SQL statement is very simple to query the next level of FID:Select name from catalog where fatherid = FIDWhen displaying these categories, we simply use $ # @ 60; Li $ # @ 62;:
$ # @ 60; %Rem oconn --- database connection, which has been enabled during deleetchildrenRem FID ----- Number of the current category
Function getchildren (oconn, FID)Str
, select the. allowview field according to the special access rules of a user.
$ SQL =! Emptyempty ($ accessmasks )?
"SELECT f. fid, f. fup, f. type, f. name, f. threads, f. posts, f. todayposts, f. lastpost, f. inheritedmod, f. forumcolumns, f. simple, ff. description, ff. moderators, ff. icon, ff. viewperm, ff. redirect,. allowview FROM {$ tablepre} forums f
Left join {$ tablepre} forumfields ff ON ff. fid
File operations are an important input/output method, that is, reading data from a data file or writing results into a data file. MATLAB provides a series of low-level input and output functions for file operations.1. Open and Close a file1) open the fileBefore reading and writing a file, you must use the fopen function to open or create the file and specify the operation method for the file. The call format of the fopen function is:Fid = fopen (file name, 'open method ')Note:
MATLAB File Operations
File operations are an important input/output method, that is, reading data from a data file or writing results into a data file. MATLAB provides a series of low-level input and output functions for file operations.1. Open and Close a file1) open the fileBefore reading and writing a file, you must use the fopen function to open or create the file and specify the operation method for the file. The call format of the fopen function is:FID = fopen (file name, 'open method ')
Today, we want to use MATLAB to pre-process the data, but we are not quite clear about the file operations on Matlab. So we searched the internet and summarized them as follows:
File operations are an important input/output method, that is, reading data from a data file or writing results into a data file. MATLAB provides a series of low-level input and output functions for file operations.
1. Open and Close a file1) open the fileBefore reading and writing a file, you must use the fopen function
as the ID2 here, its fatherid is ID1.In this way, we get the data table definition for the classification catalog:Create Table [Catalog] ([ID] [int] not NULL,[Name] [nvarchar] () not NULL,[Fatherid] [INT] Not NULL);Agreement: We agreed to use-1 as the first layer of the classification of the Father code. The category is numbered-1. This is a virtual classification. It has no records in the database.How to restore a treeThe biggest advantage of the catalog definition above is that it makes it ea
parent node of Rack. Such as
DataCenter | | ------------------ | | | | Rack Rack | | ------------ | | | | DataNode DataNode
That is, in the Masterserver maintenance topology, is to store volumeserver related information in DataNode, so in the code can be seen as follows:
dc := t.GetOrCreateDataCenter(dcName)rack := dc.GetOrCreateRack(rackName)dn := rack.
1, MATLAB file operation mainly has three steps: first open the file, then read and write to the file, and finally close the file.2, Fid=fopen (file name, open mode)
' R '
Read-only, file must exist (default open mode)
' W '
Write the file, if the file already exists, the original content will be overwritten; If the file does not exist, create a new one
A
Add at the end of the file and creat
Provides various official and user-released code examples and code reference. You are welcome to exchange and learn about infinitus classification, which is often used in projects. There are also various implementation methods for infinitus classification, next I will share a thinkphp3.0-based unlimited classification, and also supports general value-based unlimited classification. This class was found on the Internet a long time ago. The original author did not have any information. Here I just
Processing of TXT files (including characters and numbers) in MATLAB (09:45:12)
Reprinted token
Tags: Miscellaneous
Classification: MATLAB and C Learning
MATLAB file operation and read TXT file ZZ2008-07-11
MATLAB File OperationsFile operations are an important input/output method, that is, reading data from a data file or writing results into a data file. MATLAB provides a series of low-level input and output functions for file operations.1. Open and Close a file1) ope
SQL about the same parent ID, a maximum of three records table imginfo can be obtained.
Id fid miaoshu
1 3 aaaaaaa
2 3 sssssss
3 3 fffff
4 4 uuuuuuuuu
5 5 gfgfgfgfgf
6 5 ddfdfdfd
7 9 fdffdfd
8 9 dfdfdfd
9 9 dfdfdf
10 9 popopop
11 3 tgtrtyrtyry
12 5 fdsjfdfdl
SELECT * FROM 'imginfo' WHERE fid in (3,5, 9) order by 'id' DESC
All content of the above statements fid
CREATE TABLE ' type ' (
' id ' int (one) not NULL auto_increment,
' FID ' int (one) not NULL DEFAULT ' 0 ',
' Name ' varchar (not NULL),
PRIMARY KEY (' id ')
)
Copy CodeSecond, add several top-level categories to add
INSERT into ' type ' (' id ', ' fid ', ' name ') VALUES (NULL, ' 0 ', ' phone ');
INSERT into ' type ' (' id ', '
Split fields to optimize SQLToday see a function to handle the connection of SQL, is a group of a netizen, the SQL statement is as follows:SELECT so_order.fdate, so_order.fsnfrom so_order INNER JOIN so_orderitem on CHARINDEX (so_ Orderitem.fid, So_order.fid) >= 1WHERE So_order. forderdate = ' 2015-09-06 'SELECT so_order.fdate, so_order.fsnfrom so_order INNER JOIN so_orderitem on CHARINDEX (so_ Orderitem.fid, So_order.fid) >= 1WHERE So_order. forderdate =
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.