Schema Tutorial 4
- 格式:docx
- 大小:15.65 KB
- 文档页数:3
Coot TutorialCCP4School APS2010May20,2010Contents1Mousing2 2Introductory T utorial22.1Get thefiles (2)2.2Start Coot (2)2.3Display Coordinates (2)2.4Adjust Virtual Trackball (3)2.5Display maps (4)2.6Zoom in and out (5)2.7Recentre on Different Atoms (5)2.8Change the Clipping(Slab) (7)2.9Recontour the Map (7)2.10Change the Map Colour (8)2.11Select a Map (8)3Model Building83.1Rotamers (8)3.2More Real Space Refinement (9)4Blobology104.1Find Blobs (10)4.1.1Blob3 (10)4.1.2Blob2 (11)4.1.3Blob1 (12)5Extra Fun(if you have time)125.1Waters (12)5.2Working with NCS (13)5.3Add Terminal Residue (14)5.4Display Symmetry Atoms (15)5.5Skeletonization and Baton Building (16)5.6Refine with Refmac (16)6Use the EDS166.1Make a(Pretty?)Picture (17)1MousingFirst,how do we move around and select things?Left-mouse Drag Rotate viewCtrl Left-Mouse Drag Translates viewShift Left-Mouse Label AtomRight-Mouse Drag Zoom in and outMiddle-mouse Centre on atomScroll-wheel Forward Increase map contour levelScroll-wheel Backward Decrease map contour level2Introductory T utorialIn this tutorial,we will learn how to do the following:1.Start Coot2.Display coordinates3.Display a map4.Zoom in and out5.Recentre on Different Atoms6.Change the Clipping(Slab)7.Recontour the Map8.Change the Map Colour9.Display rotamers and refine residue2.1Get thefilesBefore we start,let’s get thefiles on which we will be working:$wget /coot/tutorial/tutorial-modern.pdb$wget /coot/tutorial/rnasa-1.8-all refmac1.mtz or copy them from/home/emsley/tutorial2.2Start CootTo use coot,in a terminal window,type:$cootWhen youfirst start coot,it should look something like Figure1.2.3Display CoordinatesSo let’s read in those coordinates:•Select“File”from the Coot menu-bar11Note you can also use“Alt-F”instead of clicking on“File”Figure1:Coot at StartupNot much to see at present...Actually,after this,coot screenshots will bedisplayed with a white background,whereas you will see a black one•Select the“Open Coordinates”menu item[Coot displays a Coordinates File Selection window]•Either–Select tutorial-modern.pdb from the“Files”listor–Type tutorial-modern.pdb in the Selection:entry•Click“OK”in the Coordinates File Selection window[Coot displays the coordinates in the Graphics Window]2.4Adjust Virtual TrackballBy default,Coot has a“virtual trackball”to relate the motion of the molecule to the motion of the mouse.Many people don’t like this.So you might like to try the following.In the Coot main menu-bar:Edit→Preferences...[Coot displays a Preferences window]On the left toolbar select General and then on the right top notebook tab HID. Select“Flat”to change the mouse motion.(Use the“Spherical Surface”option to turn it back to how it is by default).What is the difference?“Flat”mode is like the mode used by“O”.In both modes,dragging the mouse near the centre of the screen causes the view to rotate about the X-or Y-axis.However in spherical mode you can also rotate about thez-axis by dragging the mouse along an edge of the window.Figure2:Coot After Loading Coordinates2.5Display mapsWe are at the stage where we are looking at the results of the refinement.The refinement programs stores its data(labelled lists of structure factor amplitudes and phases)in an“MTZ”file.Let’s take a look...•Select“File”from the Coot menu-bar•Select“Auto Open MTZ”menu item[Coot displays a Dataset File Selection window]•Select thefilename rnasa-1.8-all refmac1.mtzIf you choose instead“Open MTZ,cif or phs...”you will see:•[Coot displays a Dataset File Selection window]•Select thefilename rnasa-1.8-all refmac1.mtz[Coot displays a Dataset Column Label Selection window]Figure3:Coot MTZ Column Label Selection Window Notice that you have a selection of different column labels for the“Ampli-tudes”and“Phases”,however,let’s use the defaults:“FWT”and“PHWT”.•Press“OK”in the Column Label WindowNow open the MTZfile and select column labels“DELFWT”and“PHDELWT”.So now we have2maps(whether auto-opened or not).2.6Zoom in and outTo zoom in,click Right-mouse and drag it left-to-right2.To zoom out again,move the mouse the opposite way.Figure4:Coot after reading an MTZfile and zoomed in.2.7Recentre on Different Atoms•Select“Draw”from the Coot menu-bar•Select“Go T o Atom...”[Coot displays the Go To Atom window]•Expand the tree for the“A”chain•Select1ASP in the residue list•Click“Apply”in the Go To Atom window•At your leisure,use“Next Residue”and“Previous Residue”(or“Space”and “Shift”“Space”in the graphics window)to move along the chain.•Click Middle-mouse over an atom in the graphics window[Coot recentres on that atom]•Ctrl Left-mouse&Drag moves the view around.If this is a too slow and jerky:–Select Edit→Preferences...from Coot’s menu-bar–Select the“Maps”toolbutton on the left2or up-to-down,if you prefer that–Select the“Dragged Map”notebook tab.–Select“No”in the“Active Map on Dragging”window–Click“OK”in the“Preferences”windowNow the map is recontoured at the end of the drag,not at each step3.Another,additional way to make the movements faster is to change the num-ber of steps for the“Smooth Recentering”.Again youfind this in the“Prefer-ences”(Preferences→General→Smooth Recentering).Change the“Num-ber of Steps”from the default80to something smaller,e.g.20.Figure5:Coot’s Go To Atom Window.•You can display the contacts too,as you do this:–Select“Measures”from the Coot menu-bar–Select“Environment Distances...”–Click on the“Show Residue Environment?”check-button∗Also Click“Label Atom?”if you wish the Cαatoms of the residuesto be labelled.–Click“OK”in the Environment Distances window–Click“Apply”in the Go To Atom window[You can’t change the colour of the Environment distances]You can turn off the Environment distances if you like.3which looks less good on faster computers.Figure6:Coot showing Atom Label and environment distances.2.8Change the Clipping(Slab)•Select“Draw”from the Coot menu-bar•Select“Clipping...”from the sub-menu[Coot displays a Clipping window]•Adjust the slider to the clipping of your choice•Click“OK”in the Clipping windowAlternatively,you can use“D”and“F”4on the keyboard,or Control Right-mouse up/down(Control Right-mouse left/right does z-translation).2.9Recontour the Map•Scroll your scroll-wheel forwards one click5[Coot recontours the map using a0.05electron/˚A3higher contour level]•Scroll your scroll-wheel forwards and backwards more notches and see the contour level changing.•If you don’t have a wheel on your mouse you can use“+”and“-”on the keyboard.•Note that the“Scroll”button in the Display Manager allows you to select which map is affected by this6.4think:Depth of Field.5don’t click it down.6by default it is the last map,which is not necessarily the map that you want.2.10Change the Map Colour•Select“Edit”from the Coot menu-bar•Select“Map Colour”in the sub-menu•Select“1xxx FWT PHWT”in the sub-menu[Coot displays a Map Colour Selection window]•Choose a new colour by clicking on the colour widgets[Coot changes the map colour to match the selection]•Click“OK”in the Map Colour Selection window2.11Select a MapSelect a map for model building:Menubar:Calculate→Model/Fit/Refine...[Coot displays the Model/Fit/Refine window]Select“Select Map...”from the Model/Fit/Refine windowclick OK(you want to select the map with“...FWT PHWT”)Alternatively you can use the modelling toolbar icon buttons(here“Map”)dis-played on the right side of the Coot window.Most options found in the Model/Fit/Refine window are available here too.If you are not sure which icon corresponds to which function look at the displayed tips when over the button with the mouse.Or change the display style of the buttons by clicking on the bottom arrow and select another style to get only or additionally text displayed.3Model Building“So what’s wrong with this structure?”you might ask.There are several ways to analyse structural problems and some of them are available in Coot.Validate→Density Fit Analysis→tutorial-modern.pdb[Coot displays a bar graph]Look at the graph.The bigger and redder the bar the worse the geometry.Thereare2area of outstanding badness in the A chain,around41A and89A.Let’s look at89Afirst-click on the block for89A.[Coot moves the view so that89A CA is at the centre of the screen]3.1Rotamers•Examine the situation...[The sidechain is pointing the wrong way.Let’s Fix it...]•Menubar:Calculate→Model/Fit/Refine (7)[Coot displays the Model/Fit/Refine window]•Select“Rotamers”from the Model/Fit/Refine window8.7or use the modelling toolbar on the right of the Coot window,i.e.you don’t need to open theModel/Fit/Refine window8Or click on the“Rotamers”button of the modelling toolbar•In the graphics window,(left-mouse)click on an atom of residue89A(the Cγ,say)[Coot displays the“Select Rotamer”window]•Choose the Rotamer that most closely puts the atoms into the side-chain den-sity•Click“Accept”in the“Select Rotamer”window[Coot updates the coordinates to the selected rotamer]•Click“Real Space Refine Zone”in the Model/Fit/Refine window9.•In the graphics window,click on an atom of residue89A.Click it again.[Coot displays the refined coordinates in white in the graphics and a new “Accept Refinement”window]•Click“Accept”in the“Accept Refinement”window.[Coot updates the coordinates to the refined coordinates.89A nowfits the density nicely.]OK.That’s good.Now,how about if we just use Real Space Refinement only?•Click“Undo”twice[Coot puts the sidechain back to the original position]•Click“Real Space Refine Zone”in the Model/Fit/Refine window10.•In the graphics window,click on an atom of residue89A.Click it again.[Coot displays the refined coordinates in white in the graphics and a new “Accept Refinement”window]•Now using left-mouse,click and drag on the intermediate(white)CZ atom of the PHE(if you mis-click the atom,the view will rotate).•Can you pull the atom around so that the side-chainfits the density?[Yes,you can]3.2More Real Space RefinementNow let’s have a look at the other region of outstanding badness:•Click on the graph block for41A[Coot moves the view so that41A CA is at the centre of the screen]•Examine the situation...•Residue41is in a mess and notfitting to the density.Can youfix it?[Yes,you can]•The trick is Real Space Refine that zone.So...9...or use the modelling toolbar button10...or modelling toolbar buttonFigure7:89A nowfits the density nicely.•You can either Real Space Refine a few residues(40,41and42)or just41.Take your pick.•Click on“Real Space Refine Zone”in the Model/Fit/Refine window•Select a range by clicking on atoms in the graphics window(either atoms in 40then42or an atom in41twice)[Coot displays intermediate(white)atoms]•Click and drag on some atoms until the atomsfit nicely in the density.If you want to move a single atom then Ctrl Left-mouse to pick and move(just) that intermediate atom.[Note:Selecting and moving just the Carbonyl Oxygen is a good idea-use Ctrl Left-mouse to move just one atom.]4Blobology4.1Find BlobsTo be found under Validate(called“Unmodelled Blobs”).You can use the defaults in the subsequent pop-up.Press“Find Blobs”and wait a short while.You will get a new window that tell you that it has found unexplaned blobs. Time tofind out what they are.4.1.1Blob3Let’s start from Blob3(the blobs are ordered biggest to smallest-Blobs3and4(if you have it)are the smallest).•Click on“Blob3”[Coot centres the screen on a blob]•Examine the situation...[We need something tetrahedral there...]•“Place Atom At Pointer”on the Model/Fit/Refine window11[Coot shows a Pointer Atom Type window]•“SO4”in the new window...•In the“Pointer Atom Added to Molecule:”frame,change“New Molecule”to‘‘tutorial-modern.pdb”•Click OK.•Examine the situation...•the orientation is not quite right.•Let’s Real Space Refine it(you should know what to do by now...)•(“Real Space Refine Zone”then click an atom in the SO4twice.Accept)[The SO4fits better now].Blob4is like Blob3(isn’t it?)4.1.2Blob2Click on the button“Blob2”and examine the density.Something is missing from the model.What?This protein and has been co-crystallized with its ligand substrate.That’s what missing:3’GMP.So let’s add it...•File→Get Monomer...•Type3GP in the box(Use Upper Case).Press return...[Coot pauses for a few seconds while LIBCHECK and REFMAC run][3GP appears]It is generally easier to work without hydrogens,so let’s delete them•“Delete...”from the Model/Fit/Refine window12•“Hydrogens in Residue”•click on an atom in3GP[Hydrogens disappear]The3GP is displaced from where we want it to be.•“Rotate/T ranslate Zone”from the Model/Fit/Refine window13•click on an atom in3GP twice[Intermediate(white)atoms appear]•Drag it or use the sliders to move the intermediate fragment to the approxi-mately the right place.11also available in the modelling toolbar12Found in the modelling toolbar?Of course!13Found it in the modelling toolbar?•Click“OK”in the slider window•Now optimize thefit using“Real Space Refine Zone”like we did before.Now merge this ligand into the protein:•Calculate→Merge Molecules...•Click(activate)“monomer-3GP.pdb”•into Molecule:tutorial-modern.pdb•Merge4.1.3Blob1•Click on“Blob1”•Examine the situation...What is this density?[We need to add residues to the C-terminus of the A chain.]The missing residues are GLU,THR,CYS(QTC).•Calculate→Fit Loop...[Coot pops-ups a Fit Loop dialog]Add residue number94to96in the A chain.The single letter codes of the extra residues are QTC•Make sure that you can see the unmodelled density well,then click“Fit Loop”•Watch...(fun eh?)•Examine the densityfit.[It should befine,except at the C-terminus.We need to add an OXT atom to the residue]•Calculate→Other Modelling T ools...•Add OXT to Residue...•Add it——————————————————This is a far as I expect you to get.——————————————————5Extra Fun(if you have time)5.1WatersFit waters to the structure•“Find Waters...”in the Other Modelling Tools dialog14,then OK(using the defaults)[Waters appear]14In older versions of Coot,the Find Waters button can be found in the Model/Fit/Refine dialog or the water drop in the modelling toolbarTo check the waters:•Click on“Measures”in the main menubar.•Click on Environment Distances•Click on the“Show Residue Environment?”check-button•Change the distances as you like•Use the Go To Atom widget to go to thefirst water(probably towards the end of the list of residues in Chain“W”)•Use the Spacebar to navigate to the next residue(and Shift Spacebar to go backwards)•If you don’t like the fast sliding15you can turn it off(if you haven’t done so already):–Click Edit→Preferences...in the main menubar–Click General→“Smooth Recentering...”–Click“No”5.2Working with NCSThe tutorial data has two-fold NCS.With good data it is interesting to investigate the differences between the NCS copies.This may be done by comparing the NCS related electron density,comparing the NCS related chains,or comparing the Ra-machandran plots for related chains:•Comparing the NCS related electron density.Go to Calculate/NCS maps and select thefirst map and model.Now,if you go to anywhere in the A chain,you will see two sets of electron density-the original density for the A chain,and the density for the B chain transformed to overlap the A chain density.This gives you a visual comparison of any differences.Look at the density in the B molecule.Why does the density not agree here?(Hint:the NCS is not a2-fold rotation in this case,it is improper).•Comparing the NCS-related chains.Go to Draw/NCS ghost control and select Draw non-crystallographic ghosts.You will now see a copy of the B chain superimposed on the A chain.The B chain is draw using thin bonds.Look for regions where the models ing the NCS maps tool,check that the differences in the models are supported by the density.•Compare the NCS-related chains using“NCS jumping”.This is an alternative way of examining NCS similarities and e the Display Manager to undisplay the NCS maps you recently created above.Use the“Goto Atom”dialog and press the“Update from Current Position”button.[Coot shifts the centre of the screen to the closest displayed CA atom]15it’s not very good for water checkingIdentify the chain that you are looking at(for example,by double-clicking on an atom)Now press the“o”key on the keyboard.[Coot shifts the centre of the screen to a NCS-related chain]Identify the chain that you are looking at now.Press“o”again.What is happening?(Note:”o”stands for“Other NCS-related chain”.)•Comparing the Ramachandran plots for related chains.Go to Validate/Kleywegt plot.Check the Use specific chain options and select chains A and B.You will get a Ramachandran plot with equivalent residues from the A and B chains linked by arrows.Long arrows indicate significant differences.Click on a dot to view the residue concerned.Another tool for identifying NCS differences is the Validate/NCS differences graph.This gives a clickable histogram of differences.5.3Add Terminal Residue[To be found on the Model/Fit/Refine dialog16]•Use the Go To Atom window to go to residue72A.•What do you see?[You see missing atoms(that is,you don’t see them).This residue is supposed to bea CYS!Bad things have happened to it.Let’s get rid of this residue.][There may also be waters in the side-chain positions too(they have to be removed too).]•Delete...•(Make sure“Residue/Monomer”is active)•Click on an atom of residue72A.[Residue72A disappears]•Lets’put back an ALA.•Add Terminal Residue...[Coot adds intermediate white atoms and pops up a dialog]•Accept the new atomsOK,we now have a ALA.We want a CYS:•Mutate&Auto Fit...•Click on an atom in the new ALA[Coot pops up a residue type chooser]•Choose residue type CYS[Coot mutates andfits a CYS]16and in the modelling toolbar•Examine the situation.[There is an extra blob of density on that CYS.What is it?]It is an alternative conformation.Let’s model it•Add Alt Conf...[Coot pops up a residue splitter dialog]•Choose how you want to split your residue(the Right Way is an unresolved philosophical issue...17)•Click on an atom in72A[Coot adds intermediate white atoms and pops up a Rotamer Chooser]•Choose the correct rotamer-it shouldn’t be difficult to tell which is the clos-est.•Accept when you are happy with you choice.•Now optimize thefit of this new residue with Real Space Refinement.The refinement of each alternate conformations is independent.•Real Space Refine Zone•click on(say)SG,B of72A•Press“A”(on the keyboard)[Coot moves the atoms a bit]•Accept•Now do the same with the other conformation.[Ahhh!Much better.]5.4Display Symmetry AtomsTo be found on“Draw”→“Cell&Symmetry”menu item in the main menu.Try:•Show Symmetry Atoms?→Y es•Symmetry as Calphas?[on]•Colour symmetry by molecule[on]•Symmetry Radius30˚A•Colour Merge→0.1•Show Unit Cell?[on]•OK•Zoom out and have a look at how the molecules pack together.17Actually Jane Richardson may disagree with that statement.5.5Skeletonization and Baton BuildingYou can calculate the map skeleton in Coot directly:Calculate→Map Skeleton...→On.This can be used to“baton build”a map.You can turn off the coordinates and try it if you like(the Baton Building window can be found by clicking“Ca Baton Mode...”in the Other Modelling Tools dialog18).If you want to do this,I suggest you use Go To Atom and start residue2A(this allows you to build the complete A chain in the correct direction(it takes about15 minutes or so)and you can compare it to the real structure afterwards.Remember,when you start,you are placing a CA at the baton tip and at the start you are placing atom CA1.This might seem that you are“double-backing”on yourself-which can be confusing thefirst time.5.6Refine with RefmacRefmac is a program that does Maximum Likelihood refinement of the model,and the interface to it can be found on the Model/Fit/Refine dialog.(By default there is no icon on the toolbar for this action-open the window from the calculate menu19). Now click on“Run Refmac...”(at the bottom of the Model/Fit/Refine window).The defaults should befine...“Run Refmac”in the new window......Wait...[The cycle continues...]•Use“Validate→Difference Map Peaks”tofind interesting features in the newly created map and model.•Python enabled version only:a dialog with geometric outliers and other in-teresting things(if they exist)detected by Refmac shows up20.6Use the EDSLet’s validate a structure deposited in the PDB.Use a web browser and go to http://eds.bmc.uu.se/eds/.Use the keyword search tofind the structure of a particular protein/ligand/author.File→Get PDB and Map Using EDSGet the accession code and paste it into the entry box that pops up.Use the validation tools in Coot to examine how good a PDBfile this is...[the Difference Map Peaks can be interesting]18this is quite advanced19or add your own“Run Refmac”button to the toolbar or the main/top toolbar.To add the button to the modelling/side toolbar,open the“Preference”window.Now go to Preferences→General→Refinement T oolbar.In the right hand window scroll down and tick the box besides“Run Refmac...”.A corresponding button will appear on the modelling toolbar.Alternatively you can add your own “Run Refmac...”button to the top toolbar of the Coot window(only in Python versions).Click Right-mouse on the toolbar(besides the“Display Manager”button)and you will see a pop-up menu.Select “Manage Buttons”,tick the box besides“Add Alt Conf”and click“Apply”.A new button named“Add Alt Conf”will appear on the toolbar.20This is an analysis from the Refmac logfile and can alternatively be opened from Extensions...→Refine...→Read REFMAC log6.1Make a(Pretty?)Picture(Depends on the appropriate supporting software being available):•Arrange a nice view•Press F8•Wait a few seconds...ColophonThis document is written using XEmacs21.5in L A T E X using AUCT E X and is dis-tributed with the Coot source code.。
WaveDromRendering Beautiful Waveforms from Plain TextAliaksei ChapyzhenkaJonah ProbellAbstractWaveDrom is a tool for rendering digital timing diagrams, and other technical visualization, as SVG or PNG images from an intuitive plain text language. It is easy to learn, easy to use, and browser-based. WaveDrom is free open source software./This paper provides simple and complex examples of code and its resulting graphics. Also provided are guidelines on integrating WaveDrom into source code, diffing waveforms, parameterizing waveforms, describing and visualizing constraints, expressing design intent, and generating assertions.Table of ContentsIntroduction (3)Problems with current practices (3)Inspiration (4)Exchange format (WaveJSON) (5)Image rendering (5)Waveforms in code comments (8)Diffing waveforms (9)Parameterization (10)Representing constraints in WaveJSON (11)Generating assertions (13)Other users (16)Conclusion (16)IntroductionDigital t iming diagrams (“waveforms”) are the type of diagram that best describe how electronic signals do, or should, behave. Chip designers naturally draw waveforms on whiteboards, and routinely view waves when debugging simulations. When called upon to write a specification, we know our word processing options. However, there has never been a simple, widely used tool for rendering waveforms. That is until now.WaveDrom is a tool for rendering waveforms as SVG or PNG images.1 It defines a language that uses textual symbols, which are easy to create with a keyboard, to represent the types of information that waveforms present. WaveDrom follows the software development trend of running applications in browsers for automatic portability across operating systems. The WaveDrom editor (online and offline version) is WYSIWYG. The effect of changes to text describing waveforms is immediately rendered, without a compilation step. Furthermore, since WaveDrom waveforms are described as text, they can be embedded in source code comments, in source control metadata, and diffed between versions.WaveDrom was first created by this paper’s author, Aliaksei Chapyzhenka. It is available online, as desktop application (Windows, Linux, OSX), and open source on github.2 WaveDrom is well documented online with a fun interactive tutorial.3 Others have contributed ideas, and WaveDrom has been extended for:●drawing schematic diagrams●generating register field documentation● a translator to TikZ for TeX / LaTeX typesetting4This paper intends to stimulate ideas for other extensions and other uses.Problems with current practicesWaveforms are a common, well understood, industry standard way to express hardware behavior. When done well, they effectively communicate ideas visually, in a readable way.5Some readers of this paper draw waveforms as ASCII text. Some draw diagrams manually within a word processor’s graphics tools. Some copy-paste lines and hexagons in drawing programs. Some cleverly use cell outlining features in a spreadsheet, and some will even write Verilog with #delay 1 Scalable Vector Graphics (SVG) is a vector-based graphics format recognized by many document editing programs. Portable Network Graphics (PNG) is a raster graphics format, recognized by many document editing programs. PNG is comparable to the Joint Photographic Experts Group (JPEG) format.2https:///drom/wavedrom3 /tutorial4TikZ is a description format for vector graphics rendered in TeX and LaTeX documents. Describing timing diagrams in TikZ is not intuitive. See /tikz/examples/timing-diagram/.5 Tufte, Edward. Envisioning Information, 1990, andTufte, Edward. The Visual Display of Quantitative Information, 2001.statements, run a simulation with a trace file, and take screenshots of the traces in a waveform viewer GUI. Various commercial and freeware tools are available for download and installation on PCs to produce waveforms, but none is widely used.All such methods have important limitations:1.Not everyone is a visual artist, especially at work, and especially during routinework2.It takes time to make a good drawing3.Different authors draw with different and inconsistent styles4.Drawing waveforms directly intermingles presentation and content5.It is difficult to version control, change control, and compare waveforms6.Waveforms are not interactive7.It is difficult to assemble or concatenate multiple waveforms8.Waveforms are not parameterizedAs a result, designers avoid drawing waveforms where they could be helpful. When designers draw waveforms, they require editors and technical writers to redo the drawings for clarity. WaveDrom resolves all of these limitations. Furthermore, because WaveDrom uses a textual language it can serve as a modeling language that computers can parse. Designers at several companies use WaveDrom descriptions as part of hardware design entry, design capture, or test case entry. Furthermore, some designers parse simulation traces to generate WaveDrom waveforms for selected signals.InspirationThe concept of using textual (markup) language as a source for diagram rendering engine is not new. Many domain specific language exist to drive or hint diagram rendering process. There is full spectrum of language approaches.One approach is to provide some domain specific computer language that can be utilize standard computer language processing tools like lexer and parser, and processed than as abstract syntax tree. For example DOT to describe graphs or PlantUML to describe UML diagrams.Another approach is to employs the fact that block of monospace font text can have meaningful alignment that can be understood by the computer program. The ASCII graphics type descriptions like ditaa or shaape rely on fact of 2D alignment to render sophisticated block diagrams with desired spacial relationship of it’s parts, and certain color, shape, size effects.Some of the diagram languages employ standard mark languages (typically XML) to capture structure and content. For example: CML (Chemical Markup Language) For graphic rendering of the molecular structure of chemical compounds, or MathML (Mathematical Markup Language) to describe mathematical notations. JSON is new emerging standard for data object representation replacing XML in many areas.Exchange format (WaveJSON)WaveJSON is the compact exchange format used by WaveDrom to render waveforms.6 It is based on the JSON language syntax. WaveJSON is an Embedded Domain Specific Language.7 It uses the industry-standard JSON format with additional semantics embedded into the JavaScript object structure syntax.8WaveJSON satisfies the following criteria for a useful waveform exchange format:●Text format○Plain text editor can be used○Waveform code can be inserted into HDL or software code as comment○Code can be inserted into wiki, markdown, literate, or Asciidoctor documents9●Machine readable○JSON data object notation language○Has JSON schema: https:///wavedrom/wavedrom-schema that can be used for data validation.●Domain specific language (DSL)○Great expressive power within the domain○Exhibits minimum redundancy of domain specific knowledge definition○Is an extension of a general purpose language (i.e. JavaScript)●Open Source format and tools○WaveDrom : WaveJSON → SVG rendering engine in JavaScripthttps:///drom/wavedrom○WaveDromEditor : WaveJSON editor for Desktop and Browserhttps:///wavedrom/wavedrom.github.ioImage renderingThe first and most natural use for WaveDrom is rendering of images for publishing purposes.10 Here is a code example:6 The WaveJSON format specification is at https:///drom/wavedrom/wiki/WaveJSON7Mernik, Marjan, Jan Heering, and Anthony M. Sloane. "When and how to develop domain-specific languages." ACM computing surveys (CSUR) 37.4 (2005): 316-344.Knuth, Donald Ervin. The texbook. Vol. 1993. Reading, Massachusetts: Addison-Wesley, 1986.Spinellis, Diomidis. "Notable design patterns for domain-specific languages."Journal of systems and software 56.1 (2001): 91-99.8 JavaScript Object Notation (JSON) is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. More information at /.9Knuth, Donald E. "Literate programming." CSLI Lecture Notes, Stanford, CA: Center for the Study of Language and Information (CSLI), 1992 1 (1992).Asciidoctor diagram extension at https:///asciidoctor/asciidoctor-diagram10 The online editor is available at /editor.html.The desktop application is available at https:///wavedrom/wavedrom.github.io/releases.{signal: [{wave: '01010101010101'}, // toggling{wave: '0.1.0.hl'}, // dot(.) holds a value, h/l for high and low {wave: '222xxx345.6789'}, // multi-bit, X, 345 = colors, 6789 == x{wave:''}, // blank line// text{wave: '2.2.2.2.2.2.2.',data:["abcdefg","hijk","lmnop","qrs","tuv","wx","yz"]},{wave:''},// names and clocks{name: "posclk", wave: 'pPp...........' }, // capital letters for arrows {name: "negclk", wave: 'n.N..n........' },{name: "divclk", wave: 'lplpl.h.l.h.pl' },{wave:''},// fun{name: "Barak", wave: '01.zx=ud.23.45'},// gaps{name: "gaps", wave: '01|022|0|x|.22' },// arrows with nodes and edges{name: "arrows", wave: '0n0....2..x2..',node: '.a........d' },{ wave: '1.0.10..x0....',node: '....b...c' },],edge:['a~>b glitch','c<~>d I found the bug!',],}It renders this waveform:The online tutorial has more examples and more sophisticated examples.WaveDrom render produces SVG or PNG. Standard skins can be used, but custom skins are supported for specific stylistic formatting. WaveDrom allows text to have XML style attributes.11 WaveDrom has a two panel editor that renders WaveJSON source into SVG image in realtime. The panels can be rotated to show the source and waveform horizontally or vertically. A user menu is in the lower right.11 Package available at https:///drom/tspanThe instant feedback of real time rendering gives a designer an ability to draw the intended waveform and correct mistakes very quickly.The following source code describes a DDR DRAM access:{ signal: [{ name: "CK", wave: "P.......", period: 2 },{ name: "CMD", wave: "x.3x=x4x=x=x=x=x",data: "RAS NOP CAS NOP NOP NOP NOP", phase: 0.5 },{ name: "ADDR", wave: "x.=x..=x........",data: "ROW COL", phase: 0.5 },{ name: "DQS", wave: "z.......0.1010z." },{ name: "DQ", wave: "z.........5555z.",data: "D0 D1 D2 D3" }]}Below is the rendered waveform.Waveforms in code commentsThe following Verilog module code includes a WaveDrom waveform in a code comment:module reducer(big, little)input [7:0] big;output [2:0] little;/* Waveform of example expected behavior{signal: [{name: 'big',wave: '=======',data: '0x0 0x1 0x5 0x10 0x3F 0x80 0xFF'},{name: 'little',wave: '=======',data: '0 0 3 4 5 7 7'},],}*/always @(*) beginlittle = 0;case(big)8’h02: little = 1;8’h04: little = 2;8’h08: little = 3;8’h10: little = 4;8’h20: little = 5;8’h40: little = 6;8’h80: little = 7;endcaseendendmoduleThe waveform code can be rendered for purposes of documentation. It would look like this.Diffing waveformsThough waveforms are the best way to display timing information in two dimensions, even when placed side by side it is very difficult to visually compare one to another to identify changes or differences. However, by representing waveforms as text, it is much easier to identify the difference between visual waveforms.Similarly, when a simulation or logic analyzer dumps a large amount of trace data as text, it is difficult to understand the diff in context. As long as the trace dump is in WaveDrom format, or can be easily converted to WaveDrom format by a script, then rendering the waveform as an image and looking at the point of the difference makes it much easier to understand.ParameterizationWaveDrom is built on JavaScript. Therefore, it is extensible. The example below is a waveform for a parameterizable memory block. It can return data in the same cycle, or with some latency. A JavaScript functions makes the read latency parameterizable, based on the variable rdlatency.(function (o) {var rdata = 'x.';rdata += '.'.repeat(o.rdlatency);rdata += '=..x';rdata += '.'.repeat(4 - o.rdlatency);return {signal: [{name: 'clk', wave: 'p.........'},{name: 'addr', wave: 'x=........', data: 'A<sub>0'},{name: 'rd', wave: '0.1..0....'},{name: 'rdata', wave: rdata, data: 'D<sub>0'}]};})({rdlatency: 1}) /* <-- change this */Representing constraints in WaveJSONWaveJSON has several features that can be used to describe behavioural constraints in the (human | computer) (readable | writable) language. Therefore, these features can facilitate human-machine interaction:●[signal[].wave] property represents one character per cycle, so it is possible to representalignment of several signals.●Vertical bar (|) character represents gaps in the timing.●[signal[].node] property allows placing anchors aligned with [signal[].wave] in time.●[edge] property describes dependencies between the nodes with optional textual attributes. Consider the following code.{signal: [{name: 'addr', wave: 'x=|', node: '.a..', data: 'a0'}, {},{name: 'ack', wave: '0.|1', node: '...b'},{name: 'data', wave: 'x.|=', node: '...c', data: 'd0'}],edge: ['a|->b [2:5]', 'b-c']}That yields the following waveform.Several system constraints can be drawn and analyzed from this description by human or computer. For example:1.one may expect ack to rise in 2 to 5 cycles after addr is asserted.2.The data signal should carry some payload, and be asserted on the same cycle.If the designer describes that expected behavior, then a computer can use it to:●Create a test case, and generate testbench code that behaves like the description, varyingparameters on the edges●Assert the constraint during simulation or for formal analysis●In the case of a mismatch (case failure), a computer can back-annotate the waveform,showing the difference with the actual behaviour, and use it for reporting.A report may contain multiple failing cases that look like this:{signal: [{name: 'addr', wave: 'x=x..', node: '.a..', data: '345'}, {},{name: 'ack', wave: '0.10.', node: '..b'}, {},{name: 'data', wave: 'x..=x', node: '...c', data: '825'}],edge: ['a--b expected [2:5] got 1', 'b--c expected 0 got 1'],head: {tock: 123}}rendered form:The report may have a timestamp or cycle number in a waveform header or footer section as a reference to the simulation time.Specific edges may contain more failure information.Below is code to represent a common protocol violation on an AMBA AXI read transaction.12 Text such as this could be generated by protocol checkers as part of verification IP packages:{ signal: [{ name: "CLK", wave: 'p..........', },{ name: "AR_VALID", wave: '01.0.......', },{ name: "AR_READY", wave: '0.10.......', },{ name: "AR_ADDR", wave: 'x=.x.......',data: "0x0000", },{ name: "R_VALID", wave: '0....1....0' },{ name: "R_READY", wave: '1.....01...',12 See /products/system-ip/amba-specifications.phpnode: '......a....', },{ name: "R_DATA", wave: 'x....====x.',data: "D0 D1 D2 D3",node: '.......b...', },],edge:['a~>b protocol violation: data change when READY is low'],}Below is the rendered waveform.Generating assertionsIt is possible for a user to express constraints using WaveJson in a way that they can both be rendered visually and translated, such as with a Perl script, into standard SystemVerilog assertions. There are an infinite number of ways to express constraints in WaveJson that make different trade-offs between readability and extensibility. Users should choose their format based on the range of types of assertions they intend to create, and what display format they find most readable.The authors of this paper are not recommending any particular syntax for assertion expression. Creating a script to perform a translation to SystemVerilog assertions is left as an exercise to the reader. Below are some possible examples.The following diagram is rendered from the following WaveDrom code (color added for emphasis).{ signal: [{name: 'REQ', wave: '010', node: '.ab'},{name: 'GNT', wave: '0|1', node: '..c'}],edge: ['a|>b ##[1]','a|>c ##[1:4]']}A simple translation of the WaveDrom code yields a property assertion for each edge such as the following SystemVerilog assertions.assert property (REQ |-> ##[1]~REQ); // a|bassert property (REQ |-> ##[1:4]GNT); // a|cThe translation uses the state, 1 or 0, of the wave corresponding to each node value to determine the state of the assertion implication (~ inversion). The translator uses SystemVerilog assertion syntax in the WaveDrom edge text. Other implementations could use any syntax appropriate for describing assertions. This opens a new level of assertion expression possibilities.In another example, the following WaveDrom code{signal: [{name: 'addr', wave: 'x=|', node: '.a..', data: 'a0'}, {},{name: 'ack', wave: '0.|1', node: '...b'},{name: 'data', wave: 'x.|=', node: '...c', data: 'd0'}],edge: ['a|->b ##[2:5]', 'b-c']}yieldsassert property (addr |-> ##[2:5]ack);assert property (ack |-> data);The rendered diagram looks like this.The dot character (‘.’) in WaveJson means repetition of the value of the previous cycle, which naturally maps to the SystemVerilog $stable construct.{ signal: [{ name: "READ", wave: "0.1..", node: '=.a..' },{ name: "DATA", wave: "=....", node: '=..b.' },],edge: ['a|->b']}One particular translation of the code above finds that the b node corresponds to a . in the DATA wave. Since the a node represents a transition to 1 in the READ wave, the following SystemVerilog assertion results.assert property (READ |=> $stable(DATA);The assertion waveform is rendered below.The translator converts the following WaveJson code{signal: [{name: 'full', wave: '1..', node: '.a..'},{name: 'write', wave: '1..', node: '.b..'},{name: 'read', wave: '0..', node: '.c..'},{name: 'wptr', wave: 'x=.', node: '..d.'},],edge: ['a&->d', 'b&->d', 'c&->d']}to the following SystemVerilog assertion./* full && write && !read |=> $stable(wptr) */Note that node d is the right hand side node for each edge, implying that the state of its signal (wptr) is the target of the assertion. The assertion waveform is rendered below.Other usersThe web version of WaveDrom is used by tens to hundreds of users at each of: Intel, AMD, Apple, Synopsys, Analog Devices, Nvidia, Cisco, National Semi, TI, ARM, Nvidia, HP, Marvell, Hynix, Infineon, Altera, Avago, Qualcomm, Volkswagen, Ford, and others.Many others outside of the semiconductor industry use or have adapted WaveDrom.Tutorial by Dave Vandenbout: /blog/timing-diagrams-made-easy/ Hackaday comparison to other waveform drawing applications:/2015/05/25/need-timing-diagrams-try-wavedrom/PSHDL Verilog coding game: /Yosys synthesis Verilog code verification game:http://www.clifford.at/yosys/nogit/YosysJS/snapshot/demo03.htmlCoroutine Co-simulation Test Bench (COCOTB) simulation trace to waveform usage:http://potential.ventures/beautiful-documentation.htmlBeagleBone BeagleLogic logic analyzer result display: http://beaglelogic.github.io/webapp/A simple function to add wavedrom waveforms into an ipython notebook:https:///witchard/ipython-wavedromA Trac plugin: https:///jun66j5/trac-wavedrompluginAsciidoctor Diagram extension: https:///asciidoctor/asciidoctor-diagramWhat will you do?ConclusionCurrent practices for drawing waveforms do not support a fast, easy, error-free workflow. WaveDrom does so with an intuitive plain text language for describing waveforms. A free, open source editor renders clear diagrams with a consistent format. WaveDrom text is easy to embed in source code comments. Furthermore, WaveDrom text allows for diffing waveforms. Waveforms can also be parameterized. Waveforms becomes a source for describing and for visualizing constraints. Edges within waveforms naturally indicate relationships, and can be translated to other expression syntaxes such as SystemVerilog assertions. A lot of companies already use WaveDrom in their design work. Shouldn’t you?。
1目录1 ORACLE BIEE基础 (4)1.1 OBIEE 概述 (4)1.1.1 BIEE 历史 (4)1.1.2 数据模型 (4)1.2 BIEE 安装 (5)1.2.1 JDK要求 (5)1.2.2 下载BIEE (6)1.2.3 安装BIEE (6)1.2.4 Logs (8)1.3 配置 (9)1.3.1 安装后的目录 (9)1.3.2 几个重要的配置文件 (9)1.4 预览Demo效果 (9)1.4.1 启动BI服务和OC4J (9)1.4.2 打开BIEE仪表盘 (10)2 BIEE 开发步骤 (12)2.1 数据库 (12)2.1.1 安装数据库 (12)2.2 创建资料库 (12)2.2.1 资料库 (12)2.3 创建物理模型 (13)2.3.1 导入物理表 (13)2.3.2 选择维度表和事实表 (14)2.3.3 完成物理模型 (15)2.3.4 新建主键和外键 (16)2.4 创建逻辑模型 (18)2.4.1 创建逻辑层 (18)2.4.2 查看逻辑层 (19)2.4.3 修改逻辑层 (19)2.5 创建展现模型 (20)2.5.1 创建展现层 (20)2.6 保存资料库 (21)2.6.1 保存资料库 (21)2.6.2 修改密码 (22)2.7 发布资料库 (22)2.7.1 修改NQSConfig.INI (22)2.7.2 重启Oracle BI Server (22)2.8 Answers –答复 (23)2.8.1 登陆BI Dashboards (23)2.8.2 选择主题 (23)2.8.4 新建文件夹 (25)2.8.5 保存报表 (26)2.9 Dashboards –仪表盘 (27)2.9.1 创建仪表盘 (27)2.9.2 编辑仪表盘 (27)2.9.3 查看仪表盘 (28)3 Answer详细介绍 (29)3.1 列 (29)3.1.1 新建报表 (29)3.1.2 列属性 (30)3.1.3 fx-编辑属性 (30)3.1.4 添加筛选器 (31)3.1.5 最终效果 (32)3.2 答复 (33)3.2.1 Prompts-报表提示 (33)3.2.2 Title-标题 (33)3.2.3 Legend-图例 (34)3.2.4 Narrative-叙述内容 (35)3.2.5 Ticker-标记视图 (36)3.2.6 合计 (37)3.2.7 Chart-图表 (38)3.2.8 Pivot Table-数据透视图 (39)3.2.9 Gauge-计量表 (39)3.2.10 Column Selector-列选择器 (41)3.2.11 View Selector-视图选择器 (41)4 Dashboard详细介绍 (43)4.1 仪表盘设置 (43)4.1.1 管理 (43)4.1.2 我的账户 (43)4.2 仪表盘功能 (43)4.2.1 Dashboard Prompt-仪表盘提示 (44)4.2.2 Link or Image-链接或图像 (44)4.2.3 Embedded Content-嵌入式内容 (45)4.2.4 Text-文本 (46)4.2.5 Briefing Book-简要簿 (47)4.2.6 Folder-文件夹 (49)4.2.7 Guided Nav. Link-引导导航链接 (49)4.2.8 Briefing Book Nav. Link-工作簿导航链接 (50)4.2.9 BI Publisher 报表 (51)4.2.10 条件显示内容 (51)5 Delivers介绍 (53)5.1 Scheduler 配置 (53)5.1.1 安装计划表 (53)5.1.3 添加用户认证 (55)5.1.4 查看Scheduler (56)5.2 Delivers应用 (57)5.2.1 编辑我的客户 (57)5.2.2 创建iBot (58)5.2.3 查看Alerts (60)5.2.4 发送Mail (60)6 其他功能介绍............................................................................................错误!未定义书签。
About the T utorialNeo4j is one of the popular Graph Databases and Cypher Query Language (CQL). Neo4j is written in Java Language. This tutorial explains the basics of Neo4j, Java with Neo4j, and Spring DATA with Neo4j.The tutorial is divided into sections such as Neo4j Introduction, Neo4j CQL, Neo4j CQL Functions, Neo4j Admin, etc. Each of these sections contain related topics with simple and useful examples.AudienceThis tutorial has been prepared for beginners to help them understand the basic to advanced concepts of Neo4j. It will give you enough understanding on Neo4j from where you can take yourself to a higher level of expertise.PrerequisitesBefore proceeding with this tutorial, you should have basic knowledge of Database, Graph Theory, Java, and Spring Framework.Copyright & Disclaimer© Copyright 2018 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at **************************T able of ContentsAbout the Tutorial (i)Audience (i)Prerequisites (i)Copyright & Disclaimer (i)Table of Contents (ii)1.Neo4j ─ Overview (1)What is a Graph Database? (1)Advantages of Neo4j (2)Features of Neo4j (2)2.Neo4j ─ Data Model (4)3.Neo4j ─ Environment Setup (6)Neo4j Database Server Setup with Windows exe File (6)Starting the Server (9)Working with Neo4j (11)4.Neo4j ─ Building Blocks (12)Node (12)Properties (12)Relationships (13)Labels (14)Neo4j Data Browser (14)NEO4J ─ CQL (17)5.Neo4j CQL ─ I ntroduction (18)Neo4j CQL Clauses (18)Neo4j CQL Functions (20)Neo4j CQL Data Types (21)CQL Operators (21)Boolean Operators in Neo4j CQL (22)Comparison Operators in Neo4j CQL (22)6.Neo4j CQL ─ Creating Nodes (24)Creating a Single node (24)Creating Multiple Nodes (27)Creating a Node with a Label (30)Creating a Node with Multiple Labels (33)Create Node with Properties (36)Returning the Created Node (39)7.Neo4j CQL ─ Creating a Relationship (42)Creating Relationships (42)Creating a Relationship Between the Existing Nodes (44)Creating a Relationship with Label and Properties (47)Creating a Complete Path (49)N EO4J CQL ─ WRITE CLA USES (51)8.Neo4j ─ Merge Command (52)Merging a Node with a Label (52)Merging a Node with Properties (56)OnCreate and OnMatch (58)Merge a Relationship (61)9.Neo4j ─ Set Clause (63)Setting a Property (63)Removing a Property (65)Setting Multiple Properties (67)Setting a Label on a Node (69)Setting Multiple Labels on a Node (71)10.Neo4j ─ Delete Clause (74)Deleting All Nodes and Relationships (74)Deleting a Particular Node (75)11.Neo4j ─ Remove Clause (77)Removing a Property (77)Removing a Label From a Node (79)Removing Multiple Labels (81)12.Neo4j ─ Foreach Clause (84)NEO4J CQL ─ READ CLA USES (87)13.Neo4j ─ Match Clause (88)Get All Nodes Using Match (88)Getting All Nodes Under a Specific Label (90)Match by Relationship (92)Delete All Nodes (94)14.Neo4j ─ Optional Match Clause (96)15.Neo4j ─ Where Clause (98)WHERE Clause with Multiple Conditions (101)Using Relationship with Where Clause (103)16.Neo4j ─ Count Function (106)Count (106)Group Count (108)N EO4J CQL ─ GENERAL C LAUSES (111)17.Neo4j ─ Return Clause (112)Returning Nodes (112)Returning Multiple Nodes (114)Returning Relationships (116)Returning Properties (118)Returning All Elements (120)Returning a Variable With a Column Alias (122)18.Neo4j ─ Order By Clause (124)Ordering Nodes by Multiple Properties (126)Ordering Nodes by Descending Order (128)19.Neo4j ─ Limit Clause (131)Limit with expression (133)20.Neo4j ─ Skip Clause (136)Skip Using Expression (138)21.Neo4j ─ With Clause (140)22.Neo4j ─ Unwind Clause (142)NE O4J CQL ─ FUNCTIONS (144)23.Neo4J CQL ─ String Functions (145)String Functions List (145)Upper (145)Lower (147)Substring (149)24.Neo4j ─ Aggreg ation Function (152)AGGREGATION Functions List (152)COUNT (152)MAX (155)MIN (157)AVG (159)SUM (161)N EO4J CQL ─ ADMIN (163)25.Neo4j ─ Backup & Restore (164)Neo4j Database Backup (164)Neo4j Database Restore (171)26.Neo4j ─ Index (174)Creating an Index (174)Deleting an Index (176)27.Neo4j ─ Create Unique Constraint (179)Create UNIQUE Constraint (179)28.Neo4j ─ Drop Unique (182)Neo4j5Neo4j is the world's leading open source Graph Database which is developed using Java technology. It is highly scalable and schema free (NoSQL).What is a Graph Database?A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links . It is composed of two elements - nodes (vertices) and relationships (edges).Graph database is a database used to model the data in the form of graph. In here, the nodes of a graph depict the entities while the relationships depict the association of these nodes. Popular Graph DatabasesNeo4j is a popular Graph Database. Other Graph Databases are Oracle NoSQL Database, OrientDB, HypherGraphDB, GraphBase, InfiniteGraph, and AllegroGraph.Why Graph Databases?Nowadays, most of the data exists in the form of the relationship between different objects and more often, the relationship between the data is more valuable than the data itself.Relational databases store highly structured data which have several records storing the same type of data so they can be used to store structured data and, they do not store the relationships between the data.Unlike other databases, graph databases store relationships and connections as first-class entities.The data model for graph databases is simpler compared to other databases and, they can be used with OLTP systems. They provide features like transactional integrity and operational availability.RDBMS Vs Graph DatabaseFollowing is the table which compares Relational databases and Graph databases.1.Advantages of Neo4jFollowing are the advantages of Neo4j.∙Flexible data model: Neo4j provides a flexible simple and yet powerful data model, which can be easily changed according to the applications and industries.∙Real-time insights: Neo4j provides results based on real-time data.∙High availability: Neo4j is highly available for large enterprise real-time applications with transactional guarantees.∙Connected and semi structures data:Using Neo4j, you can easily represent connected and semi-structured data.∙Easy retrieval: Using Neo4j, you can not only represent but also easily retrieve (traverse/navigate) connected data faster when compared to other databases.∙Cypher query language: Neo4j provides a declarative query language to represent the graph visually, using an ascii-art syntax. The commands of this language are in human readable format and very easy to learn.∙No joins: Using Neo4j, it does NOT require complex joins to retrieve connected/related data as it is very easy to retrieve its adjacent node or relationship details without joins or indexes.Features of Neo4jFollowing are the notable features of Neo4j -∙Data model (flexible schema): Neo4j follows a data model named native property graph model. Here, the graph contains nodes (entities) and these nodes are connected with each other (depicted by relationships). Nodes and relationships store data in key-value pairs known as properties.In Neo4j, there is no need to follow a fixed schema. You can add or remove properties as per requirement. It also provides schema constraints.6∙ACID properties: Neo4j supports full ACID (Atomicity, Consistency, Isolation, and Durability) rules.∙Scalability and reliability: You can scale the database by increasing the number of reads/writes, and the volume without effecting the query processing speed and data integrity. Neo4j also provides support for replication for data safety and reliability.∙Cypher Query Language: Neo4j provides a powerful declarative query language known as Cypher. It uses ASCII-art for depicting graphs. Cypher is easy to learn and can be used to create and retrieve relations between data without using the complex queries like Joins.∙Built-in web application: Neo4j provides a built-in Neo4j Browser web application.Using this, you can create and query your graph data.∙Drivers: Neo4j can work with –o REST API to work with programming languages such as Java, Spring, Scala etc.o Java Script to work with UI MVC frameworks such as Node JS.o It supports two kinds of Java API: Cypher API and Native Java API to develop Java applications.In addition to these, you can also work with other databases such as MongoDB, Cassandra, etc.∙Indexing: Neo4j supports Indexes by using Apache Lucence.7Neo4j8Neo4j Property Graph Data ModelNeo4j Graph Database follows the Property Graph Model to store and manage its data. Following are the key features of Property Graph Model:∙The model represents data in Nodes, Relationships and Properties ∙Properties are key-value pairs ∙ Nodes are represented using circle and Relationships are represented using arrow keys ∙Relationships have directions: Unidirectional and Bidirectional ∙ Each Relationship contains "Start Node" or "From Node" and "To Node" or "End Node" ∙Both Nodes and Relationships contain properties ∙ Relationships connects nodesIn Property Graph Data Model, relationships should be directional. If we try to create relationships without direction, then it will throw an error message.In Neo4j too, relationships should be directional. If we try to create relationships without direction, then Neo4j will throw an error message saying that "Relationships should be directional".Neo4j Graph Database stores all of its data in Nodes and Relationships. We neither need any additional RRBMS Database nor any SQL database to store Neo4j database data. It stores its data in terms of Graphs in its native format.Neo4j uses Native GPE (Graph Processing Engine) to work with its Native graph storage format.The main building blocks of Graph DB Data Model are:∙Nodes ∙Relationships ∙Properties2.Neo4j Following is a simple example of a Property Graph.Here, we have represented Nodes using Circles. Relationships are represented using Arrows. Relationships are directional. We can represent Node's data in terms of Properties (key-value pairs). In this example, we have represented each Node's Id property within the Node's Circle.9Neo4j10In this chapter, we will discuss how to install Neo4j in your system using exe file.Neo4j Database Server Setup with Windows exe FileFollow the steps given below to download Neo4j into your system.Step 1: Visit the Neo4j official site using https:///. On clicking, this link will take you to the homepage of neo4j website.Step 2: As highlighted in the above screenshot, this page has a Download button on the top right hand side. Click it.Step 3: This will redirect you to the downloads page, where you can download the community edition and the enterprise edition of Neo4j. Download the community edition of the software by clicking the respective button.3.Step 4: This will take you to the page where you can download community version of Neo4j software compatible with different operating systems. Download the file respective to the desired operating system.11This will download a file named neo4j-community_windows-x64_3_1_1.exe to your system as shown in the following screenshot.12Step 5: Double-click the exe file to install Neo4j Server.Step 6: Accept the license agreement and proceed with the installation. After completion of the process, you can observe that Neo4j is installed in your system.Starting the ServerStep 1: Click the Windows startmenu and start the Neo4j server by clicking the start menu shortcut for Neo4j.13Step 2: On clicking the shortcut, you will get a window for Neo4j Community edition. By default, it selects c:\Users\[username]\Documents\Neo4j\default.graphdb. If you want, you can change your path to a different directory.14Step 3: Click the "Start" button to start the Neo4j server.Once the server starts, you can observe that the database directory is populated as shown in the following screenshot.15Working with Neo4jAs discussed in the previous chapters, neo4j provides an in-built browse application to work with Neo4j. You can access Neo4j using the URL http://localhost:7474/16Neo4j17Neo4j Graph Database has the following building blocks -∙ Nodes ∙ Properties ∙ Relationships ∙ Labels ∙Data BrowserNodeNode is a fundamental unit of a Graph. It contains properties with key-value pairs as shown in the following image.Here, Node Name = "Employee" and it contains a set of properties as key-value pairs.4.PropertiesProperty is a key-value pair to describe Graph Nodes and Relationships.Where Key is a String and Value may be represented using any Neo4j Data types.RelationshipsRelationships are another major building block of a Graph Database. It connects two nodes as depicted in the following figure.Here, Emp and Dept are two different nodes. "WORKS_FOR" is a relationship between Emp and Dept nodes.As it denotes, the arrow mark from Emp to Dept, this relationship describes -Each relationship contains one start node and one end node.Here, "Emp" is a start node, and "Dept" is an end node.As this relationship arrow mark represents a relationship from "Emp" node to "Dept" node, this relationship is known as an "Incoming Relationship" to "Dept" Node and "Outgoing Relationship" to "Emp" node.Like nodes, relationships also can contain properties as key-value pairs.18Here, "WORKS_FOR" relationship has one property as key-value pair.It represents an Id of this relationship.LabelsLabel associates a common name to a set of nodes or relationships. A node or relationship can contain one or more labels. We can create new labels to existing nodes or relationships. We can remove the existing labels from the existing nodes or relationships.From the previous diagram, we can observe that there are two nodes.Left side node has a Label: "Emp" and the right side node has a Label: "Dept". Relationship between those two nodes also has a Label: "WORKS_FOR".Note: Neo4j stores data in Properties of Nodes or Relationships.Neo4j Data BrowserOnce we install Neo4j, we can access Neo4j Data Browser using the following URL19Neo4j Data Browser is used to execute CQL commands and view the output.Here, we need to execute all CQL commands at dollar prompt: "$"Type commands after the dollar symbol and click the "Execute" button to run your commands. It interacts with Neo4j Database Server, retrieves and displays the results just below the dollar prompt.Use "VI View" button to view the results in diagrams format. The above diagram shows results in "UI View" format.Use "Grid View" button to view the results in Grid View. The following diagram shows the same results in "Grid View" format.20When we use "Grid View" to view our Query results, we can export them into a file in two different formats.21CSVClick the "Export CSV" button to export the results in csv file format.JSONClick the "Export JSON" button to export the results in JSON file format.22However, if we use "UI View" to see our Query results, we can export them into a file in only one format: JSON23Neo4j ─ CQL24Neo4j25CQL stands for Cypher Query Language. Like Oracle Database has query language SQL, Neo4j has CQL as query language.Neo4j CQL -∙ Is a query language for Neo4j Graph Database. ∙ Is a declarative pattern-matching language. ∙ Follows SQL like syntax.∙Syntax is very simple and in human readable format.Like Oracle SQL -∙ Neo4j CQL has commands to perform Database operations.∙Neo4j CQL supports many clauses such as WHERE, ORDER BY, etc., to write very complex queries in an easy manner.∙Neo4j CQL supports some functions such as String, Aggregation. In addition to them, it also supports some Relationship Functions.Neo4j CQL ClausesFollowing are the read clauses of Neo4j C ypher Q uery L anguage: 5.Following are the write clauses of Neo4j C ypher Q uery L anguage:Following are the general clauses of Neo4j C ypher Q uery L anguage:26Neo4j CQL FunctionsFollowing are the frequently used Neo4j CQL Functions:We will discuss all Neo4j CQL commands, clauses and functions syntax, usage and examples in-detail in the subsequent chapters.27End of ebook previewIf you liked what you saw…Buy it from our store @ https://28。
Table of ContentsAbout1 Chapter 1: Getting started with Visual Studio2 Remarks2 Versions2 Examples3 Installation or Setup4 Chapter 2: Adding an extension5 Examples5 Adding an extension to visual studio using a `VSIX` file5 Adding an extension to visual studio from Visual Studio Gallery5 Chapter 3: Code Contracts9 Remarks9 Examples9 Standard precondition9 Precondition that throws a specific Exception9 Pre and postconditions9 Chapter 4: Connecting your visual studio project to Github10 Examples10 Publishing your project to a github repository removing sensitive data10 Chapter 5: Visual Studio tools18 Examples18 Code Lens18 Snippets18 Intoduction18 Using the code181. Header192. Snippet202.1 Imports202.2 Declarations212.3 References222.4 Code22 Import Snippet into Visual Studio25 Point of intrest27 Override merge/compare tools27 Entity Framework28 Credits29AboutYou can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: visual-studioIt is an unofficial and free Visual Studio ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official Visual Studio.The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to ********************Chapter 1: Getting started with Visual Studio RemarksVisual Studio is an Integrated Development Environment (IDE) from Microsoft. It enables the developer to work project orientated with various types of projects, including Windows Forms, Console Applications, Office Plug-Ins, and Windows Universal Apps.The IDE supports various programming languages, the most common being Visual C#, Visual Basic, Visual F#, and Visual C++.There are several editions of Visual Studio: Community (free), Express (free), Professional, Enterprise, and Ultimate (However, not all are available for all versions).VersionsExamplesInstallation or SetupVisual Studio can be downloaded and installed for free in Comunity edition from the Microsoft site and can be also found in different versions. Just click on the Download button and run the executable, then follow the instructions.Read Getting started with Visual Studio online: https:///visual-studio/topic/972/getting-started-with-visual-studioChapter 2: Adding an extensionExamplesAdding an extension to visual studio using a `VSIX` fileIf you have a vsix file, you can install it by running the file.Get the vsix file (this is the extension installer)1.2.Run the file.3.In the window that opens, confirm the installation.Adding an extension to visual studio from Visual Studio GalleryIn Visual studio•go to Tools > Extensions and updates...•In the window that opens go to online•Select Visual Studio GalleryYou can search for an extension on the search box at the upper right corner••Select the extension you want to addClick on download.••Once download is complete, click on the Install button on the window that opened.•In order to use the extension, you might be requested to restart visual studioRead Adding an extension online: https:///visual-studio/topic/2257/adding-an-extensionChapter 3: Code ContractsRemarksIn order to fully benefit from Code Contracts you need to install the extension for Visual Studio. There's also a Code Contracts User Manual.ExamplesStandard preconditionusing System.Diagnostics.Contracts;public int DivideNumbers(int numerator, int denominator){Contract.Requires(denominator != 0);return numerator / denominator;}Precondition that throws a specific Exceptionusing System.Diagnostics.Contracts;public int DivideNumbers(int numerator, int denominator){Contract.Requires<ArgumentOutOfRangeException>(denominator != 0);return numerator / denominator;}Pre and postconditionsusing System.Diagnostics.Contracts;public int IncrementByRandomAmount(int input){Contract.Requires<ArgumentNullException>(input != null); // Don't allow null parameter. Contract.Requires<ArgumentOutOfRangeException>(input < int.MaxValue); // We can't do anything if we're given int.MaxValue.Contract.Ensures(Contract.Result<int>() > input); // Return value will be greater than input value.Random rnd = new Random();input += rnd.Next(1, 13); // Creates a number between 1 and 12 and adds it to input.return input;}Read Code Contracts online: https:///visual-studio/topic/6311/code-contractsChapter 4: Connecting your visual studio project to GithubExamplesPublishing your project to a github repository removing sensitive datathe steps in this example will use the following project structure as a demonstrationand we intend to export it to the "GHTuts" Repository [Note that the Repo doesn't exist yet on github] but leave the "SensitiveProject" without publish as it contains some passwords, keys, etc..1.First of all we make sure the source control plug in is set to "Git" in "Tools > Options > Plug-in Selection"If you can't see the "Team Explorer" tab, view it in visual studio like this 2. Go to your local solution folder and create a new file called ".gitignore.txt" [Note] this step is only important if you have some sensitive information in your project,otherwise, let visual studio create it for you1. Now open the ".gitignore.txt" file and paste this in it, this is a template for ignoring common visual studio files (check the links below)2. ## Ignore Visual Studio temporary files, build results, and## files generated by popular Visual Studio add-ons.# User-specific files*.suo*.user*.userosscache*.sln.docstates# User-specific files (MonoDevelop/Xamarin Studio)*.userprefs# Build results[Dd]ebug/[Dd]ebugPublic/[Rr]elease/[Rr]eleases/x64/x86/bld/ [Bb]in/[Oo]bj/[Ll]og/# Visual Studio 2015 cache/options directory.vs/# Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/# MSTest test Results[Tt]est[Rr]esult*/[Bb]uild[Ll]og.*# NUNIT*.VisualState.xmlTestResult.xml# Build Results of an ATL Project[Dd]ebugPS/[Rr]eleasePS/dlldata.c# DNXproject.lock.jsonproject.fragment.lock.jsonartifacts/*_i.c*_p.c*_i.h*.ilk*.meta*.obj*.pch*.pdb*.pgc*.pgd*.rsp*.sbr*.tlb*.tli*.tlh*.tmp*.tmp_proj*.log*.vspscc*.vssscc.builds*.pidb*.svclog*.scc# Chutzpah Test files_Chutzpah*# Visual C++ cache filesipch/*.aps*.ncb*.opendb*.opensdf*.sdf*.cachefile*.VC.db*.VC.VC.opendb# Visual Studio profiler*.psess*.vsp*.vspx*.sap# TFS 2012 Local Workspace$tf/# Guidance Automation Toolkit*.gpState# ReSharper is a .NET coding add-in_ReSharper*/*.[Rr]e[Ss]harper*er# JustCode is a .NET coding add-in.JustCode# TeamCity is a build add-in_TeamCity*# DotCover is a Code Coverage Tool*.dotCover# NCrunch_NCrunch_*.*crunch*.local.xmlnCrunchTemp_*# MightyMoose*.mm.*/# Web workbench (sass).sass-cache/# Installshield output folder[Ee]xpress/# DocProject is a documentation generator add-in DocProject/buildhelp/DocProject/Help/*.HxTDocProject/Help/*.HxCDocProject/Help/*.hhcDocProject/Help/*.hhkDocProject/Help/*.hhpDocProject/Help/Html2DocProject/Help/html# Click-Once directorypublish/# Publish Web Output*.[Pp]ublish.xml*.azurePubxml# TODO: Comment the next line if you want to checkin your web deploy settings# but database connection strings (with potential passwords) will be unencrypted*.pubxml*.publishproj# Microsoft Azure Web App publish settings. Comment the next line if you want to# checkin your Azure Web App publish settings, but sensitive information contained# in these scripts will be unencryptedPublishScripts/# NuGet Packages*.nupkg# The packages folder can be ignored because of Package Restore**/packages/*# except build/, which is used as an MSBuild target.!**/packages/build/# Uncomment if necessary however generally it will be regenerated when needed#!**/packages/repositories.config# NuGet v3's project.json files produces more ignoreable files*.nuget.props*.nuget.targets# Microsoft Azure Build Outputcsx/*.build.csdef# Microsoft Azure Emulatorecf/rcf/# Windows Store app package directories and filesAppPackages/BundleArtifacts/Package.StoreAssociation.xml_pkginfo.txt# Visual Studio cache files# files ending in .cache can be ignored*.[Cc]ache# but keep track of directories ending in .cache!*.[Cc]ache/# OthersClientBin/~$**~*.dbmdl*.dbproj.schemaview*.pfx*.publishsettingsnode_modules/orleans.codegen.cs# Since there are multiple workflows, uncomment next line to ignore bower_components # (https:///github/gitignore/pull/1529#issuecomment-104372622)#bower_components/# RIA/Silverlight projectsGenerated_Code/# Backup & report files from converting an old project file# to a newer Visual Studio version. Backup files are not needed,# because we have git ;-)_UpgradeReport_Files/Backup*/UpgradeLog*.XMLUpgradeLog*.htm# SQL Server files*.mdf*.ldf# Business Intelligence projects*.rdl.data*yout*.bim_*.settings# Microsoft FakesFakesAssemblies/# GhostDoc plugin setting file*.GhostDoc.xml# Node.js Tools for Visual Studio.ntvs_analysis.dat# Visual Studio 6 build log*.plg# Visual Studio 6 workspace options file*.opt# Visual Studio LightSwitch build output**/*.HTMLClient/GeneratedArtifacts**/*.DesktopClient/GeneratedArtifacts**/*.DesktopClient/ModelManifest.xml**/*.Server/GeneratedArtifacts**/*.Server/ModelManifest.xml_Pvt_Extensions# Paket dependency manager.paket/paket.exepaket-files/# FAKE - F# Make.fake/# JetBrains Rider.idea/*.sln.iml3.Now add your sensitive project folder to the ".gitignore.txt" file at any line that doesn't contain #, so just add it at the very end, and it should look something like this4.Right click on the solution and choose "Add Solution to Source Control..."[Note] it might ask you to save the solution before you continueNow you have a "LOCAL" git Repo on your pc , which VS will read from,but without a github 5.Repo, and you will see a small blue lock icon next to each file in the solution that was addedto git and a red circle at the ignored project[Note]for more information about .gitignore file, check these links•https:///articles/ignoring-files/•https:///github/gitignoreGo to the "Team Explorer" tab and then "Sync"7.Now we create a repo from vs to github like this, press the "Get Started" button8.Now fill in your information in github for the new Repo, then click "Publish"9. Now when we go to github we see our local repo got published to github without oursensitive project [Note]the url of the repo will look something like thishttps:///<user name>/<repo name>10. Read Connecting your visual studio project to Github online: https:///visual-studio/topic/3826/connecting-your-visual-studio-project-to-githubChapter 5: Visual Studio toolsExamplesCode LensCode lens is a simple way to know what happens with the code. Here you could find an image with the number of references of a method or class.If you can't see the code lens please see this question: Missing CodeLens references count in VS 2015 Community editionSnippetsIntoductionSince Visual Studio 2005 can you make Intellisense Code Snippets. This allow you to generate some code just by typing one keyword and press two times the tab key.Using the codeThe XML code you need for make an Intellisense Code Snippet stands below:<?xml version="1.0" encoding="utf-8"?><CodeSnippets xmlns="/VisualStudio/CodeSnippet"><CodeSnippet Format="1.0.0"> <!-- format attribute is required --><Header> <!-- 1 --><Title></Title><Author></Author><Shortcut></Shortcut><Description></Description><Keywords><Keyword>abc<Keyword><Keyword>def<Keyword></keywords></Header><Snippet> <!-- 2 --><Imports> <!-- 2.1 --><Import><Namespace>System</Namespace></Import></Imports><Declarations> <!-- 2.2 --><Literal Editable="true/false"> <!-- 2.2.1 --><ID>example</ID><Type>System.String</Type><ToolTip>A tip you can show</ToolTip><Default>default value</Default><Function></Function> <!-- 2.2.2 --></Literal><Object> <!-- 2.2.1 --><ID>example</ID><Type>System.String</Type><ToolTip>A tip you can show</ToolTip><Default>default value</Default><Function></Function> <!-- 2.2.2 --></Object></Declarations><References> <!-- 2.3 --><Reference><Assembly>System.Data.dll</Assembly></Reference></References><Code Language=""> <!-- 2.4 --><![CDATA[<!-- your code here if you use literals use dollar chars -->]]></Code></Snippet></CodeSnippet></CodeSnippets>In the snippet tag, you have two required tags named Header and Snippet. You can find more information in next headings. The number near the name are correspondents with the numbers in the code above.There can be zero or more CodeSnippet elements added into the CodeSnippets element.1. HeaderIn the Header-tag, you can place some specific information about the snippet and what he does. The important tags you can use inside this tag are:Source table (but edits): 2. SnippetIn the snippet tag, you can use three different tags. This can be:•Imports•Declarations•Code (required)•ReferencesThese are explained below.2.1 ImportsImports contain the needed namespaces you need for the code. Use the import-tag inside this tag and here you can place the needed namespaces each with the Namespace-tag.2.2 DeclarationsDeclarations can be used for declaring some literals or objects into your code in the Code-tag. The children are literals and objects.2.2.1 Literals and objectsLiterals and objects define the literals and objects of the code snippet that you can edit. Functionality are literals and objects are the same, but it has an additional type constraint.The Literal and object-tag can contain next children:•ID: The ID of the literal (required)•Type: The type of that object including namespace and class (required by objects)•ToolTip: Gives a tip•Default: A default value of that object (required)•FunctionsIn the snippets, there are some predefined literals. They are listed below:Functions in the Literal- or Object-tag means that you can use a function for generating code depending on another element. There are three functions that I know:1 only available in Visual Studio 2005.Source table: Attributes for the Literal and Object ElementsThe Literal and Object tags can have some optional attributes.Source table: 2.3 ReferencesGroups reference elements that contains information about assembly references for the code snippet. This can contain next elements:Assembly: Contains the name of the assembly by the code snippet (required)•Url: Contains a website that gives more information about the assembly•2.4 CodeCode is the code you will generate between <![CDATA[ and ]]>. Place the ID of your literal between dollar chars and Visual Studio will ask you for change these default value if the declarations are filled in. Here, you've an example for C# and VB for the shortcut propfull.<!-- ... Other code ... --><Declarations><Literal><Id>variablename</Id><Default>_myproperty</Default></Literal><Literal><Id>propertytype</Id><Default>int</Default></Literal><Literal><Id>propertyname</Id><Default>myproperty</Default></Literal></Declarations><Code Language="CSharp"><![CDATA[private $propertyvalue$ $variablename$;public $propertyvalue$ $propertyname${get { return $variablename$; }set { $Variablename$ = Value; }}]]></Code><!-- ... Other code ... --><Declarations><Literal><Id>variablename</Id><Default>_myproperty</Default></Literal><Literal><Id>propertytype</Id><Default>int</Default></Literal><Literal><Id>propertyname</Id><Default>myproperty</Default></Literal></Declarations><Code Language="VB"><![CDATA[Private $variablename$ As $propertyvalue$Public Property $propertyname$ As $propertyvalue$GetReturn $variablename$End GetSet (ByVal value As $propertyvalue$)$variablename$ = valueEnd SetEnd Property]]></Code><!-- ... Other code ... -->In the required Language attribute, you can define your language where you are making thesnippet. You can find the languages you can use in the next table.Other optional attributes are:The valid values for the kind variable are:Source tables: Import Snippet into Visual Studio1.Save the XML code and give it the extension .snippet.You can add the new made snippet into Visual Studio by pressing Control + K, Control + B or2.go to "Tools" → "Code Snippets Manager...". This open next window:Choose the language into the combo box for which language you've made the snippet. click on "Import..."and choose the file you've made.3. Click on "Finish". If the file name already has been used, Visual Studio go ask to override the existing file. You've three options:Overwrite: Overwrites the file. You can use this option if you will edit an old snippet.•Rename: Goes to rename the file to an unique name.•Skip: Cancels the import. Renames the file to a unique name.•4. You could also add a new location with all the snippets you've made by clicking on the "Add..." button on the first window and select the folder in the "select folder window". The advantage is now when a new valid snippet is added in that folder, you can use this directly in Visual Studio.Note: Test after importing your snippet for errors, so you don't have any problems when you usethe snippet. You can always remove or overwrite the snippet if there is an error.Point of intrestYou can also see the documentation on MSDN for more information.Override merge/compare toolsGot to Tools | Options | Source Control | Visual Studio Team Foundation Serverclick on the Configure User Tools:You can add separate overrides for 'Compare' and 'Merge' operations. Click on Add and select the operation you want to override. You'd need to type the path to the tool you use, and the exact arguments your tool expects. For example to use BeyondCompare, add the following Arguments " %1 %2 /title1=%6 /title2=%7":To Merge with BeyondCompare use the Arguments "%1 %2 %3 %4 /title1=%6 /title2=%7/title3=%8 /title4=%9"In a 2006 blog post MS employee James Manning surveyed the arguments as expected by various tools: WinDiff, DiffDoc, WinMerge, Beyond Compare, KDiff3, Araxis, Compare It!, SourceGear DiffMerge, TortoiseMerge and Visual SlickEdit. The post is a good starting point, but be sure to check the up to date documentation of your tool.It is highly recommended not to use for merge tools that are incapable of 3-way merges (e.g., WinMerge 2.x).Entity FrameworkEntity Framework (EF) is an object-relational mapper that enables .NET developers towork with relational data using domain-specific objects. It eliminates the need for mostof the data-access code that developers usually need to write.Entity Framework allows you to create a model by writing code or using boxes andlines in the EF Designer. Both of these approaches can be used to target an existingdatabase or create a new database.Source and more information: Entity Framework documentationRead Visual Studio tools online: https:///visual-studio/topic/2398/visual-studio-toolsCredits。
ContentsPreface ixAcknowledgments xiPart I Using and making mapsChapter 1 Introduction 1Tutorial 1-1 Opening and saving a map document 2Tutorial 1-2 Working with map layers 5Tutorial 1-3 Navigating in a map document 12Tutorial 1-4 Measuring distances 21Tutorial 1-5 Working with feature attributes 24Tutorial 1-6 Selecting features 29Tutorial 1-7 Changing selection options 30Tutorial 1-8 Working with attribute tables 36Tutorial 1-9 Labeling features 43Assignment 1-1 Analyze population by race in the top 10 US states 46Assignment 1-2 Produce a crime map 49Chapter 2 Map design 51Tutorial 2-1 Creating point and polygon maps using qualitative attributes 52 Tutorial 2-2 Creating point and polygon maps using quantitative attributes 62 Tutorial 2-3 Creating custom classes for a map 66Tutorial 2-4 Creating custom colors for a map 70Tutorial 2-5 Creating normalized and density maps 73Tutorial 2-6 Creating dot density maps 78Tutorial 2-7 Creating fishnet maps 80Tutorial 2-8 Creating group layers and layer packages 86Assignment 2-1 Create a map showing schools in New York City by type 92 Assignment 2-2 Create maps for military sites and congressional districts 93 Assignment 2-3 Create maps for US veteran unemployment status 95Chapter 3 GIS outputs 97Tutorial 3-1 Building an interactive GIS 97Tutorial 3-2 Creating map layouts 104Tutorial 3-3 Reusing a custom map layout 111Tutorial 3-4 Creating a custom map template with two maps 113Tutorial 3-5 Adding a report to a layout 119viGIS TUTORIAL FOR ARCGIS DESKTOP 10.8Tutorial 3-6 Adding a graph to a layout 121Tutorial 3-7 Building a map animation 123Tutorial 3-8 Using ArcGIS Online 128Assignment 3-1 Create a dynamic map of historic buildings in downtown Pittsburgh 128Assignment 3-2 Create a layout comparing 2010 elderly and youth population compositions in Orange County, California 130Assignment 3-3 Create an animation for an auto theft crime time series 131Part II Working with spatial dataChapter 4 File geodatabases 133Tutorial 4-1 Building a file geodatabase 133Tutorial 4-2 Using ArcCatalog utilities 136Tutorial 4-3 Modifying an attribute table 139Tutorial 4-4 Joining tables 142Tutorial 4-5 Creating centroid coordinates in a table 144Tutorial 4-6 Aggregating data 148Assignment 4-1 Investigate educational attainment 153Assignment 4-2 Compare serious crime with poverty in Pittsburgh 155Chapter 5 Spatial data 159Tutorial 5-1 Examining metadata 160Tutorial 5-2 Working with world map projections 162Tutorial 5-3 Working with US map projections 165Tutorial 5-4 Working with rectangular coordinate systems 167Tutorial 5-5 Learning about vector data formats 172Tutorial 5-6 Exploring raster basemaps from Esri web services 178Tutorial 5-7 Downloading raster maps from the USGS 181Chapter 6 Geoprocessing 185Tutorial 6-1 Extracting features for a study area 185Tutorial 6-2 Clipping features 190Tutorial 6-3 Dissolving features 192Tutorial 6-4 Merging features 195Tutorial 6-5 Intersecting layers 199Tutorial 6-6 Unioning layers 202Tutorial 6-7 Automating geoprocessing using ModelBuilder 208Assignment 6-1 Build a study region for Colorado counties 220Assignment 6-2 Dissolve property parcels to create a zoning map 222Assignment 6-3 Build a model to create a fishnet map layer for a study area 223Chapter 7 Digitizing 227Tutorial 7-1 Digitizing polygon features 228Tutorial 7-2 Digitizing line features 239Tutorial 7-3 Digitizing point features 245Tutorial 7-4 Using advanced editing tools 248Tutorial 7-5 Spatially adjusting features 255Assignment 7-1 Digitize police beats 259COnTEnTS viiAssignment 7-2 Use GIS to track campus information 261Chapter 8 Geocoding 263Tutorial 8-1 Geocoding data by ZIP Code 263Tutorial 8-2 Geocoding data by street address 268Tutorial 8-3 Correcting source addresses using interactive rematch 274Tutorial 8-4 Correcting street reference layer addresses 276Tutorial 8-5 Using an alias table 281Assignment 8-1 Geocode household hazardous waste participants to ZIP Codes 282Assignment 8-2 Geocode immigrant-run businesses to Pittsburgh streets 284Assignment 8-3 Examine match option parameters for geocoding 285Part III Analyzing spatial dataChapter 9 Spatial analysis 289Tutorial 9-1 Buffering points for proximity analysis 290Tutorial 9-2 Conducting a site suitability analysis 295Tutorial 9-3 Using multiple ring buffers for calibrating a gravity model 299Assignment 9-1 Analyze population in California cities at risk for earthquakes 308Assignment 9-2 Analyze visits to the Jack Stack public pool in Pittsburgh 310Chapter 10 ArcGIS 3D Analyst for Desktop 313Tutorial 10-1 Creating a 3D scene 314Tutorial 10-2 Creating a TIN from contours 315Tutorial 10-3 Draping features onto a TIN 320Tutorial 10-4 Navigating scenes 326Tutorial 10-5 Creating an animation 330Tutorial 10-6 Using 3D effects 332Tutorial 10-7 Using 3D symbols 335Tutorial 10-8 Editing 3D objects 339Tutorial 10-9 Using 3D Analyst for landform analysis 342Tutorial 10-10 Exploring ArcGlobe 348Assignment 10-1 Develop a 3D presentation for downtown historic sites 352Assignment 10-2 Topographic site analysis 354Assignment 10-3 3D animation of a conservatory study area 355Chapter 11 ArcGIS Spatial Analyst for Desktop 357Tutorial 11-1 Processing raster map layers 358Tutorial 11-2 Creating a hillshade raster layer 363Tutorial 11-3 Making a kernel density map 365Tutorial 11-4 Extracting raster value points 371Tutorial 11-5 Conducting a raster-based site suitability study 374Assignment 11-1 Create a mask and hillshade for suburbs 381Assignment 11-2 Estimate heart attack fatalities outside hospitals by gender 383Chapter 12 ArcGIS Network Analyst for Desktop 385Tutorial 12-1 Solving the “traveling salesperson” problem 386Tutorial 12-2 Building a TIGER-based network dataset 394viiiGIS TUTORIAL FOR ARCGIS DESKTOP 10.8Tutorial 12-3 Creating travel polygons 402Tutorial 12-4 Locating facilities 409Tutorial 12-5 Routing vehicles from depots to demand points 414Assignment 12-1 Geographic access to federally qualified health centers 421Assignment 12-2 Analyze visits to the Phillips public pool in Pittsburgh 423Assignment 12-3 Locate new farmers’ markets in Washington, DC 424Appendix Data source credits 427。
GROMACS TutorialStep One: Prepare the Protein TopologyWe must download the protein structure file we will be working with. For this tutorial, we will utilize T4 lysozyme L99A/M102Q (PDB code 3HTB). Go to the RCSB website and download the PDB text for the crystal structure.Once you have downloaded the structure, you can visualize it using a viewing program such as VMD, Chimera, PyMOL, etc. Once you've had a look at the molecule, you are going to want to strip out the crystal waters, PO4, and BME. Note that such a procedure is not universally appropriate (i.e., the case of a bound active site water molecule). For our intentions here, we do not need crystal water or other ligands. We will instead focus on the ligand called "JZ4."If you want a cleaned version of the .pdb file to check your work, you can download it here. The problem we now face is that the JZ4 ligand is not a recognized entity in any of the force fields provided with GROMACS, so pdb2gmx will give a fatal error if you were try to pass this file through it. Topologies can only be assembled automatically if an entry for a building block is present in the .rtp file for the force field. Since this is not the case, we will prepare our system topology in two steps:1.Prepare the protein topology with pdb2gmx2.Prepare the ligand topology using external toolsSince we will be preparing these two topologies separately, we must move the protein and JZ4 into separate coordinate files. Save the JZ4 coordinates like so:grep JZ4 3HTB_clean.pdb > JZ4.pdbThen simply delete the JZ4 lines from 3HTB_clean.pdb. At this point, preparing the protein topology is trivial. There are no missing atoms or residues in the 3HTB structure, so simply run pdb2gmx:pdb2gmx -f 3HTB_clean.pdb -o 3HTB_processed.gro -water spcThe structure will be processed by pdb2gmx, and you will be prompted to choose a force field:Select the Force Field:From '/usr/local/gromacs/share/gromacs/top':1: AMBER03 force field (Duan et al., J. Comp. Chem. 24, 1999-2012, 2003)2: AMBER94 force field (Cornell et al., JACS 117, 5179-5197, 1995)3: AMBER96 force field (Kollman et al., Acc. Chem. Res. 29, 461-469, 1996)4: AMBER99 force field (Wang et al., J. Comp. Chem. 21, 1049-1074, 2000)5: AMBER99SB force field (Hornak et al., Proteins 65, 712-725, 2006)6: AMBER99SB-ILDN force field (Lindorff-Larsen et al., Proteins 78, 1950-58, 2010)7: AMBERGS force field (Garcia & Sanbonmatsu, PNAS 99, 2782-2787, 2002)8: CHARMM27 all-atom force field (with CMAP) - version 2.09: GROMOS96 43a1 force field10: GROMOS96 43a2 force field (improved alkane dihedrals)11: GROMOS96 45a3 force field (Schuler JCC 2001 22 1205)12: GROMOS96 53a5 force field (JCC 2004 vol 25 pag 1656)13: GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)14: OPLS-AA/L all-atom force field (2001 aminoacid dihedrals)15: [DEPRECATED] Encad all-atom force field, using full solvent charges16: [DEPRECATED] Encad all-atom force field, using scaled-down vacuum charges17: [DEPRECATED] Gromacs force field (see manual)18: [DEPRECATED] Gromacs force field with hydrogens for NMRFor this tutorial, we will use the united-atom GROMOS96 43A1 force field, so type 9 at the command prompt, followed by 'Enter'Step Two: Prepare the Ligand TopologyFor this tutorial, we will use PRODRG to generate a starting topology for our ligand, JZ4. Go to the PRODRG site and upload your JZ4.pdb file. The server presents you with several options for how to treat your ligand:∙Chirality (yes/no): maintain chiral centers in the input molecule (yes), or reconstruct them (no). In our case, we have no chirality, so leave this option set to its default.∙Charges (full/reduced): full charges are for condensed-phase systems (43A1 force field);reduced are for "vacuum" simulations (43B1 force field). Use full charges for nearly allapplications. The accuracy of 43B1 is debatable, anyway.∙EM (yes/no): perform energy minimization (yes), or leave coordinates alone (no). In our case, we want to construct our protein-ligand complex from existing coordinates, so wedo not want PRODRG to minimize our molecule in vacuo. Choose "no" for this option.∙Force field (GROMOS96.1/GROMOS87): "GROMOS96.1" refers to the first version of the GROMOS96 force field, 43A1. "GROMOS87" refers to the (outdated!) GROMOS87 force field. Choose "GROMOS96.1" to get 43A1 parameters for our ligand.We will make use of two files that PRODRG gives us. Save the output of the field "The GROMOS87/GROMACS coordinate file (polar/aromatic hydrogens)" into a text file called"jz4.gro" and "The GROMACS topology" into a file called "drg.itp."Let's take a look at the [ atoms ] section of our JZ4 topology:[ atoms ]; nr type resnr resid atom cgnr charge mass1 CH3 1 JZ4 C4 1 0.000 15.03502 CH2 1 JZ4 C14 2 0.059 14.02703 CH2 1 JZ4 C13 2 0.060 14.02704 C 1 JZ4 C12 2 -0.041 12.01105 CR1 1 JZ4 C11 2 -0.026 12.01106 HC 1 JZ4 H11 2 0.006 1.00807 CR1 1 JZ4 C7 2 -0.026 12.01108 HC 1 JZ4 H7 2 0.006 1.00809 CR1 1 JZ4 C8 2 -0.026 12.011010 HC 1 JZ4 H8 2 0.007 1.008011 CR1 1 JZ4 C9 2 -0.026 12.011012 HC 1 JZ4 H9 2 0.007 1.008013 C 1 JZ4 C10 3 0.137 12.011014 OA 1 JZ4 OAB 3 -0.172 15.999415 H 1 JZ4 HAB 3 0.035 1.0080I immediately notice three things that are wrong with this topology:1.Charge group 2 encompasses the entire aromatic ring, nearly all of the atoms in thismolecule.2.Charges of equivalent functional groups (C-H) are not uniform. In some cases, H atomsare +0.006e, and in other cases they are +0.007e.3.Charges on these atoms bear no resemblance whatsoever to the expected chargesprescribed by the force field.So what do we do? If you read the paper linked above, you would know what I'm going to recommend already. Assign charges and charge groups from equivalent functional groups in a building block-style manner. For any unknown groups, perform the charge calculations suggested in the paper. Since JZ4 involves only functional groups found in proteins (hydrophobic chain, aromatic ring, and an alcohol), life is pretty easy. We can re-assign charges and charge groups from these moieties. I will not go into proper topology validation in this tutorial; it would be far too time-consuming. Suffice it to say that you must satisfy reviewers that the parameters applied to your molecule are reliable. They should reproduce some well-known observable, such as logP or ΔG hydr, as in the GROMOS96 literature. If you cannot satisfy these requirements for your own system, you may want to reconsider your choice of force field.I would construct a topology that has something like this for an [ atoms ] directive:[ atoms ]; nr type resnr resid atom cgnr charge mass1 CH3 1 JZ4 C4 1 0.000 15.03502 CH2 1 JZ4 C14 2 0.000 14.02703 CH2 1 JZ4 C13 2 0.000 14.02704 C 1 JZ4 C12 2 0.000 12.01105 CR1 1 JZ4 C11 3 -0.100 12.01106 HC 1 JZ4 H11 3 0.100 1.00807 CR1 1 JZ4 C7 4 -0.100 12.01108 HC 1 JZ4 H7 4 0.100 1.00809 CR1 1 JZ4 C8 5 -0.100 12.011010 HC 1 JZ4 H8 5 0.100 1.008011 CR1 1 JZ4 C9 6 -0.100 12.011012 HC 1 JZ4 H9 6 0.100 1.008013 C 1 JZ4 C10 7 0.150 12.011014 OA 1 JZ4 OAB 7 -0.548 15.999415 H 1 JZ4 HAB 7 0.398 1.0080Note that equivalent functional groups have equivalent charges, hydrophobic groups are completely uncharged, and the charge groups are of a sensible size (2-3 atoms). The other elements of the topology are sufficiently accurate. Bonded parameters assigned by PRODRG are generally reliable. We are now ready to construct the system topology and reconstruct our protein-ligand complex.Build the ComplexFrom pdb2gmx, we have a file called "conf.gro" that contains the processed, force field-compliant structure of our protein. We also have "jz4.gro" from PRODRG that has included all of the necessary H atoms. Simply copy the coordinate section of jz4.gro and paste it into conf.gro, below the last line of the protein atoms, and before the box vectors, like so:163ASN C 1691 0.621 -0.740 -0.126163ASN O1 1692 0.624 -0.616 -0.140163ASN O2 1693 0.683 -0.703 -0.0115.99500 5.19182 9.66100 0.00000 0.00000 -2.99750 0.00000 0.00000 0.00000becomes (added text in bold green)...163ASN C 1691 0.621 -0.740 -0.126163ASN O1 1692 0.624 -0.616 -0.140163ASN O2 1693 0.683 -0.703 -0.0111JZ4 C4 1 2.429 -2.412 -0.0071JZ4 C14 2 2.392 -2.470 -0.1391JZ4 C13 3 2.246 -2.441 -0.1811JZ4 C12 4 2.229 -2.519 -0.3081JZ4 C11 5 2.169 -2.646 -0.2951JZ4 H11 6 2.135 -2.683 -0.1991JZ4 C7 7 2.155 -2.721 -0.4111JZ4 H7 8 2.104 -2.817 -0.4071JZ4 C8 9 2.207 -2.675 -0.5331JZ4 H8 10 2.199 -2.738 -0.6211JZ4 C9 11 2.267 -2.551 -0.5451JZ4 H9 12 2.306 -2.516 -0.6401JZ4 C10 13 2.277 -2.473 -0.4301JZ4 OAB 14 2.341 -2.354 -0.4341JZ4 HAB 15 2.369 -2.334 -0.5285.99500 5.19182 9.66100 0.00000 0.00000 -2.99750 0.00000 0.00000 0.00000Since we have added 15 more atoms into the .gro file, increment the second line of conf.gro to reflect this change. There should be 1708 atoms in the coordinate file now.Build the TopologyIncluding the parameters for the JZ4 ligand in the system topology is very easy. Just insert a line that says #include "drg.itp" into topol.top after the position restraint file is included. The inclusion of position restraints indicates the end of the "Protein" moleculetype section.; Include Position restraint file#ifdef POSRES#include "posre.itp"#endif; Include water topology#include "gromos43a1.ff/spc.itp"becomes...; Include Position restraint file#ifdef POSRES#include "posre.itp"#endif; Include ligand topology#include "drg.itp"; Include water topology#include "gromos43a1.ff/spc.itp"The last adjustment to be made is in the [ molecules ] directive. To account for the fact that there is a new molecule in conf.gro, we have to add it here, like so:[ molecules ]; Compound #molsProtein_chain_A 1JZ4 1The topology and coordinate file are now in agreement with respect to the contents of the system. Step Three: Defining the Unit Cell & Adding SolventAt this point, the workflow is just like any other MD simulation. We will define the unit cell andfill it with water.editconf -f conf.gro -o newbox.gro -bt dodecahedron -d 1.0genbox -cp newbox.gro -cs spc216.gro -p topol.top -o solv.groStep Four: Adding IonsWe now have a solvated system that contains a charged protein. The output of pdb2gmx told us that the protein has a net charge of +6e (based on its amino acid composition). If you missed this information in the pdb2gmx output, look at the last line of your [ atoms ] directive in topol.top; it should read (in part) qtot。
CONTENTSSetting up and importing a serviceChanging input and output typesInvoking the external serviceCopying input values Getting and copyingthe number of records returnedDeploying and testing as a SOAP serviceTesting the process as a RESTful serviceCalling a RESTful service Converting XML to JSON to input into the service Reference image of the completed process This tutorial assumes that you have completed the previous tutorials and builds upon them.In previous tutorials you used the Process Design Studio to create everything your project needed. For example, you created complex types for input and output variables. Creating a complex type involves defining a schema, or structure. In tuto-rial four you created an output type that had four elements, one each for the sum of nodes, the average, the product, and the sum of every other node. In addition to defining schema within the Process Design Studio, you can also import schema from an external source.In this tutorial, you will import an external service and use schema from it as the input type in your project. The project will send a last name, state, and middle initial to a Web service, which will respond with all matching records. You will test the service as both a SOAP web service and a RESTful service. The project will then output a count of records returned. Prerequisites:• Micro Focus Verastream Process Design Studio• An installed and running Micro Focus Verastream Process Server• Internet browser• Some familiarity with XML Schema, WSDL, XPath, BPEL, REST, JSON, and Web service standardsLet’s get started.Tutorial 5: Importing a Service9. On the Name and Confirm dialog, the Name field is popu -lated with the name of the service. You can change this name. Click Finish , then OK .10. In the BPEL Editor, delete the DoSomethingHere activity(and the AssignValue it contains) from your default project.11. Save the project.You can import a service at any time by selecting File > Import Service . You will see the Import Service dialog, shown in step 6 of this lesson.By default, the process server’s name is ‘local-host’. If your server has a different name, replace ‘localhost’ with the name of your server.Registered services are those hosted by Verastream HostIntegrator or Verastream Process Designer.The service you will import, CCSDemoService, is part of the default installation for Verastream Process Designer. If you modified the default installation, you may need to reinstall or change the URL required in this process in order to complete the tutorial.1. Start the Process Design Studio (Start > Micro FocusVerastream > P rocess Designer > Process Design Studio ).2. From the File menu, select New Project .3. Name the new project ExternalService and click Next .4. From the File menu, open the Import Services dialog box.5. On Import Service, make sure that Import a registeredservice is selected.6. Click Next .7. From the Available Services dialog box, expandVerastream Process Designer. If you cannot expand the node, click Manage Servers to add the Process Server. Add the name of the machine where the Process Server is located. In our case it is localhost. Click OK.8. Expand localhost, Web Services Container, and then selectCCSDemoService and click Next .Setting up and importing a serviceSetting up and importing a serviceTypes defined in imported services are added to the list of types available in your Workspace.The next step is to change the input type in your project to a new type, defined in the service you just imported.1. In the Service Explorer, right-click the top node and selectOpen WSDL . This opens the WSDL Editor. Verify you are in Design mode by checking the tabs at the bottom on theeditor.2. In the WSDL Editor, click the arrow to the right of Requestto open the Schema Editor.3. To add input elements to the process, right-clickRequestType and select Add Element. Repeat this step until you have three elements. You can use Input as your first element.4. Rename the elements: LastName, MiddleInitial, and Stateusing the General tab of the Properties view.5. Save the project. Close the Schema Editor and the WSDLEditor.Defining input and output typesOn the Preferencesmenu, the BPEL Property, Initialize VariablesAutomatically, is selected by default. This means that all variables are initialized when they are created.To use the CCSDemo AccountSearch service, you must invoke it as part of your BPEL process. Invoking it will add its Input and Output variables to your project.1. Insert an Assign activity between ReceiveInput andReplyWithOutput by selecting Assign in the palette and then clicking between those activities.2. In the Properties view, open the Description tab andchange the name from Assign to AssignInputs .3. Open the Service Explorer tab, expand CCSDemoService ,and drag AccountSearch into the BPEL Editor. Place itbetween AssignInputs and ReplyWithOutput.Invoking the external serviceYou can use the up and down arrows in the Details tab on the far right to change their order.Your ExternalService process now receives three elements of input (last name, middle initial, state), and then invokes an external service. The next step is to copy the input coming into your process to the input variable for the external service. This must be done before the external service is invoked.1. In the BPEL Editor, select AssignInputs , and in theDetails tab of the Properties view, open the Copy Rule dialog box( ). You are going to add three copy rules.2. On the From side, expand request:InputMessage and payload:Request, and select LastName . On the To side, expand CCSDemo_AccountSearch_Input:AccountSearch , and select parameters:AccountS earch:AccountSearch and select LastName . Repeat this process for MiddleInitial and State. You should have three copy rules. Click OK .3. Save the project.Copying input valuesThe CCSDemo service will return a number of records inresponse to the input your process provides. The last step is to fill the Output variable of your process with the count of records returned by the service.1. On the Palette, select the Assign activity, then clickbetween Invoke_CCSDemo_AccountSearch and ReplyWithOutput.2. Name the new Assign activity AssignOutput.3. Select AssignOutput , and in the Details tab of theProperties view, add a copy rule ( ).4. In the From dropdown, select Expression , then click XPath Expression Editor...5. In the Functions tree, expand Node and double-clickcount . With item_sequence selected, in the Variables tree, expandCCSDemoService_AccountSearch_Output:AccountSearchResponse,then expand parameters:AccountSearchRespo nse: AccountSearchResponse and double-click return:accountRecord.6. Delete [1] (the 1 and the brackets around it). Click OK .7. On the To side, expand response:OutputMessage , andexpand payload:Response, and select Output:String. Click OK .Getting and copying the number of records returnedThe default username and passwords for the local-host server are: adminand secret.The Web Services Exploreris a browser-based tool that provides a medium to test SOAP-based Webservices.Remember to select the SOAP11Binding to testagainst.It’s time to deploy and test your new process.1. From the File menu, select Deploy to Process Server .2. Enter the name, username and password for the server.3. In the Deployment Succeeded dialog box, click TestService to launch the Web Services Explorer.4. You will see three inputs: LastName, MiddleInitial, andState. Click the Add link next to each.5. For LastName input Smithfor MiddleInitial input C for State input RI then press Go .6. The Output string should be 14.Deploying and testing as a SOAP serviceTesting the process as a RESTful serviceAfter you create and deploy your project, it is available to you as either a SOAP-based web service or a RESTful service. This allows you to execute your service using standard HTTP calls sending and receiving common data formats such as JSON and XML.• The complete URL to the RESTful service is the base URLplus the project name and the name of the operation you want to call. For example:Base URL: http://localhost:8282/vse/processes/Complete URL: http://localhost:8282/vse/processes/ExternalService/Records• VPD RESTful services only support the HTTP POST requesttype.• Content type may be application/JSON or application/XML.An example of using the Curl utility to call the RESTful service:curl -X POST http://localhost:8282/vse/processes/ExternalService/Records -H “Content-Type: appli-cation/json” -d ‘{“Request”:{“LastName”:”Smith”, “MiddleInitial”:”C”, “State”:”RI”}}’If you are running Curl on Windows you may need to escape the double quotation marks.An example of a simple JQuery request using AJAX:var ajaxRequest = $.ajax({url: ‘http://localhost:8282/vse/processes/ExternalService/Records’, contentType: ‘application/json; charset=UTF-8’,type: ‘POST’,dataType:‘json’,data: ‘{“Input”: {“LastName”:”Smith”, “MiddleInitial”:”C”, “StateAbbr”:”RI”}}’ });In this example the contentType was ‘application/json’. Thismeans that the service will be expecting the input to be in JSON format and the output will also be in JSON format:{“Response”: { “Output”: 14 }}For a Verastream Process Designer service to be called RESTfully, its input must be a complex type. You cannot use simple inputs, such as strings, as input. In VPD all inputs and outputs are complex by default.To view operationsexposed by the project in the Service Explorer, you must first enable this option in Windows > Preferences > Project.Determining the inputs to your RESTful serviceThere are many free online conversion tools available on the Internet.Verify that your inputs and outputs are compatible with JSON. Not all XML maps successfully to JSON.VPD RESTful services support the POST HTTP request method. The content type may be appli-cation/XML or application/ JSON.JSON is typically used in RESTful services.POST request bodies are used to input data to the service.q0 is the name prefix of the service. When convert-ing, do not include the Envelope or the Header. You can use the Web Service Explorer and online XML to JSONconversion tools to help determine what the JSON input to yourRESTful service will look like.For example the operation, Records, takes three string inputs:LastName, MiddleInitial, and State.The XML, generated by Web Services Explorer, looks like this:To convert the XML to JSON:1. Remove the name prefix (q0). JSON does not usenamespaces.2. Paste the cleaned-up XML into the XML to JSON conver-sion tool you have selected. The JSON output should looklike this:{"Request": {"LastName": "Smith","MiddleInitial”: "C","State": "RI"}}This will be used as the JSON input to your service.Reference image of the completed process。
Oracle®Java CAPS XSLT Service Engine TutorialPart No:821–2616March2011Copyright©2009,2011,Oracle and/or its affiliates.All rights reserved.License Restrictions Warranty/Consequential Damages DisclaimerThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws.Except as expressly permitted in your license agreement or allowed by law,you may not use,copy,reproduce,translate,broadcast,modify,license, transmit,distribute,exhibit,perform,publish or display any part,in any form,or by any means.Reverse engineering,disassembly,or decompilation of this software, unless required by law for interoperability,is prohibited.Warranty DisclaimerThe information contained herein is subject to change without notice and is not warranted to be error-free.If you find any errors,please report them to us in writing. Restricted Rights NoticeIf this is software or related documentation that is delivered to the ernment or anyone licensing it on behalf of the ernment,the following notice is applicable:ERNMENT RIGHTSPrograms,software,databases,and related documentation and technical data delivered to ernment customers are"commercial computer software"or "commercial technical data"pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations.As such,the use,duplication, disclosure,modification,and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract,and,to the extent applicable by the terms of the Government contract,the additional rights set forth in FAR52.227-19,Commercial Computer Software License(December2007). Oracle America,Inc.,500Oracle Parkway,Redwood City,CA94065.Hazardous Applications NoticeThis software or hardware is developed for general use in a variety of information management applications.It is not developed or intended for use in any inherently dangerous applications,including applications that may create a risk of personal injury.If you use this software or hardware in dangerous applications,then you shall be responsible to take all appropriate fail-safe,backup,redundancy,and other measures to ensure its safe use.Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.Trademark NoticeOracle and Java are registered trademarks of Oracle and/or its affiliates.Other names may be trademarks of their respective owners.Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation.All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International,Inc.AMD,Opteron,the AMD logo,and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices.UNIX is a registered trademark of The Open Group in the United States and other countries.Third Party Content,Products,and Services DisclaimerThis software or hardware and documentation may provide access to or information on content,products,and services from third parties.Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content,products,and services.Oracle Corporation and its affiliates will not be responsible for any loss,costs,or damages incurred due to your access to or use of third-party content,products,or services.120126@25097ContentsXSLT Designer:Simple Transformation Tutorial (5)Overview (5)Configuring the Tutorial Environment (5)Creating the XSLT Module Project (6)▼To Create a New XSLT Module Project (6)Creating XML Schemas (7)▼To Create the XML Schema for the Incoming Message (7)▼To Create the XML Schema for the Outgoing Message (9)Creating a WSDL File (10)▼To Create a WSDL File (10)Creating an XSLT Service (11)▼To Create an XSLT Service (11)▼To Populate the XSL Stylesheet (12)Creating and Deploying the Composite Application (13)▼To Create a Composite Application Project (13)▼To Add a JBI Module (14)▼To Deploy the HelloXSLTCAP Composite Application (14)Performing a Test Run of the XSL Transformation Service (15)▼To Create a Test Case (15)▼To Test the Application: (17)34XSLT Designer:SimpleTransformationTutorialThe list below comprises the subjects covered in this topic:■“Overview”on page5■“Configuring the Tutorial Environment”on page5■“Creating the XSLT Module Project”on page6■“Creating XML Schemas”on page7■“Creating a WSDL File”on page10■“Creating and Deploying the Composite Application”on page13■“Performing a Test Run of the XSL Transformation Service”on page15OverviewIn this tutorial you become acquainted with the XSLT Service Designer,which is part of theOracle Java Composite Application Suite(Java CAPS).The XSLT Designer is used to develop,deploy and test XSL Transformation Services.An XSL Transformation Service acts as a webservice.It receives messages from a client,transforms them,and either sends the messages backto the originator or forwards them to another web service.In this tutorial you will create a simple XSL Transformation Service that receives a message,transforms it,and sends it back to the calling web service.Configuring the Tutorial EnvironmentPerform the following steps to confirm that GlassFish V2Application Server is installed andthat the JBI runtime contains the XSLT Service Engine and Transform Shared Library requiredfor this tutorial:1.Open the Services window.2.Expand the Servers node.53.Right-click the GlassFish V2node and choose Start form the popup menu.If the Start option is not available and there is a green “badge”next to the GlassFish V2node,that means the server is already running.4.After the server is started,expand the GlassFish V2>JBI node.Then expand the SharedLibraries node to verify that sun-wsdl-ext-library is installed.Creating the XSLT Module ProjectAn XSL Transformation Service is created within an XSLT Module project.▼To Create a New XSLT Module Project From the IDE's main menu,choose File >New Project.Under Categories select SOA.Under Projects,select XSLT Module.Click Next.In the Project Name field,typeHelloXSLTransformation.12345Creating the XSLT Module ProjectOracle Java CAPS XSLT Service EngineTutorial •March 20116Modify the project location,or accept the default.Click Finish.The Projects window now contains the HelloXSLTransformation project node.Expand the HelloXSLTransformation >Transformation Files node.Note that thetransformmap.xml file was created,which is a custom configuration file used to define transformation processes.In the next steps you create two XML Schema (.xsd )files,a web service description (.wsdl )file and an XSL stylesheet (.xsl )file.To run an XSL Transformation Service,you need at least one XML Schema,one WSDL file and one XSL stylesheet.For the purpose of this tutorial,you create two XML Schemas.Creating XML SchemasIn this step you are going to create two XML Schema files:HelloXSLTIncoming.xsd as a basis for the incoming message,and HelloXSLTOutgoing.xsd as a basis for the outgoing message.▼To Create the XML Schema for the Incoming Message In the Projects window,right-click the HelloXSLTransformation >Transformation Files node andchoose New >XML Schema.In the File Name field,typeHelloXSLTIncoming.678912Creating XML SchemasXSLT Designer:SimpleTransformationTutorial 7Click Finish.A new node—HelloXSLTIncoming.xsd—appears under theTransformation Files node in your HelloXSLTransformation project and the new Schema opens in the XML Schema Editor.In the first column of the Schema view,right-click Elements and choose Add Element from the popup menu.The Add Element dialog box opens.In the Name field,type name .UnderType,select the Use ExistingType radio button.Expand the Built-inTypes node and select string,and click OK.To view the source of the Schema you created,click the Source button on the XML Schema Editor toolbar.You should see the following code:<?xml version="1.0"encoding="UTF-8"?><xsd:schema xmlns:xsd="/2001/XMLSchema "targetNamespace="/schema/HelloXSLTIncoming "xmlns:tns="/schema/HelloXSLTIncoming "elementFormDefault="qualified "><xsd:element name="name "type="xsd:string "></xsd:element></xsd:schema>345678Creating XML SchemasOracle Java CAPS XSLT Service EngineTutorial •March 20118▼To Create the XML Schema for the Outgoing Message In the Projects window,right-click the HelloXSLTransformation >Transformation Files node andchoose New >XML Schema.In the File Name field,type HelloXSLTOutgoing.Click Finish.A new node—HelloXSLTOutgoing.xsd —appears under theTransformation Files node in your HelloXSLTransformation project and the new Schema opens in the XML Schema Editor.In the first column of the Schema view,right-click Elements and choose Add Element from the popup menu.The Element dialog box opens.In the Name field,type greeting .UnderType,select the Use ExistingType radio button.Expand the Built-inTypes node,select string and click OK.To view the source of the Schema you created,click the Source button on the XML Schema Editor toolbar.You should see the following code:<?xml version="1.0"encoding="UTF-8"?><xsd:schema xmlns:xsd="/2001/XMLSchema "targetNamespace="/schema/HelloXSLTOutgoing "xmlns:tns="/schema/HelloXSLTOutgoing "elementFormDefault="qualified "><xsd:element name="greeting "type="xsd:string "></xsd:element></xsd:schema>Click the Save All button on the toolbar.You should see two Schema files listed under the Transformation Files node in your HelloXSLTransformationproject.123456789Creating XML SchemasXSLT Designer:SimpleTransformationTutorial 9Creating a WSDL FileIn this step you create a web service description file that defines the web interface of our XSLT Service.▼To Create a WSDL File In the Projects window,right-click the HelloXSLTransformation >Transformation Files node and choose New >WSDL Document.In the File Name field,type HelloXSLTWSDL .Select Concrete WSDL Document as the WSDL type.Select SOAP from the Binding drop-down list,and Document Literal from theType drop-down list,then click Next.The Abstract Configuration window will open.Under Input,in the Element OrType column,click the ellipsis button.The Select Element OrType dialog box opens.Scroll up and select By File >HelloXSLTransformation >src/HelloXSLTIncoming.xsd >Elements >name and click OK.Under Output,in the Element OrType column,click the ellipsis button.The Select Element Or Type dialog box opens.Select By File >HelloXSLTransformation >src/HelloXSLTOutgoing.xsd >Elements >greeting and clickOK.12345678Creating a WSDL FileOracle Java CAPS XSLT Service EngineTutorial •March 201110Click Next.On the Concrete Configuration page review the values and click Finish.You should see theHelloXSLTWSDL.wsdl file listed under theTransformation Files node in yourHelloXSLTransformation project.Note –Creating and editing WSDL files is not covered in this tutorial.For more informationabout the WSDL Editor,see Oracle Java CAPS WSDL Editor User’s Guide .Creating an XSLT ServiceIn this step,you will create a simple request-reply XSLT service,which is a web service thatreceives input messages,transforms them in accordance with an XSL stylesheet,and sends themback.▼To Create an XSLT Service In the Projects window,right-click the HelloXSLTransformation >Transformation Files node andchoose New >XSLT Service.In the ServiceType window,ensure that the Request-Reply Service radio button is selected andclick Next.In the next step,enter HelloXSLTService as the service name and click Choose to selectOperation for theservice.910123Creating an XSLT ServiceIn theTransformMap Service Parameters window,expand the upper node with the target namespace until you see the operation,select HelloXSLTWSDLOperation and click Next.Click Finish.The HelloXSLTService.xsl file opens in the XSLT Editor,where you can only view and edit the source code.Now you need to populate the XSL stylesheet with the transformation rules.The XSL stylesheet defines how to transform the input XML document.In this version of the XSLT Designer,you can only edit the source code in the Source view.▼To Populate the XSL Stylesheet Open the HelloXSLTService.xsl file and type in the following code:<?xml version="1.0"encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="/1999/XSL/Transform "version="1.xmlns:ns1="/schema/HelloXSLTIncoming xmlns:ns="/schema/HelloXSLTOutgoing"451Creating an XSLT Service<xsl:template match="/"><xsl:element name="ns:greeting "><xsl:value-of select="concat('Hello ',/ns1:name)"/></xsl:element></xsl:template></xsl:stylesheet>Press the Validate File button on the toolbar to ensure that the code has no errors.Right-click the HelloXSLTransformation node and choose Clean and Build from the drop-downmenu to build the project.You should see the BUILD SUCCESSFUL message after building theproject completes.Creating and Deploying the Composite ApplicationAn XSLT project is not directly deployable.You must first add an XSLT project as a JBI moduleto a Composite Application project before you can deploy the Composite Application project.Deploying the project makes the service assembly available to the application server as a JBIservice unit.After deployment,you will be able to perform a test run of your XSLT service.▼To Create a Composite Application Project Choose File >New Project from the main menu.Under Categories,select SOA.Under Projects,select Composite Application.Click Next.In the Project Name field,type HelloXSLTCAP .Specify a project location or accept the default.Click Finish.23123456Creating and Deploying the Composite ApplicationThe Projects window now contains the HelloXSLTCAP project node.▼To Add a JBI Module Right-click the HelloXSLTCAP node and choose Add JBI Module from the popup menu.Select the HelloXSLTransformation project and click Add Project Jar Files.To verify that the JBI module has been added,expand HelloXSLTCAP >JBI Modules.▼To Deploy the HelloXSLTCAP Composite Application In the Projects window,right-click the HelloXSLTCAP node and choose Deploy Project from the popup menu.This operation might take a while because the it starts the GlassFish ApplicationServer.71231Creating and Deploying the Composite ApplicationNote:If the Warning -Select Server dialog box appears,select the Application Server and clickOK.In the Output window that opens in the lower part of the IDE,watch for the BUILD SUCCESSFULmessage.To verify that the project has been deployed,expand GlassFish V2>JBI >Service Assemblies inthe Runtime window.You should see the HelloXSLTCAP node.Performing a Test Run of the XSL Transformation ServiceTesting an XSL Transformation Service means sending a message that the Service is expectingand receiving,in this case,a reply message.Before we can perform the testing,we must create a test case.▼To Create a Test Case In the Projects window,expand the HelloXSLTCAP node and right-click theTest node.From the popup menu,select NewTest Case.In theTest Case Name field,type JohnSmith .Click Next.Under Select the WSDL Document,expand HelloXSLTransformation -XSLT Process Files andselect HelloXSLTWSDL.wsdl .Click Next.Under Select the Operation toTest,expand HelloXSLTWSDLBinding and selectHelloXSLTWSDLOperation.ClickFinish.2312345Performing aTest Run of the XSLTransformation ServiceThe JohnSmith node appears under HelloXSLTCAP >Test and the input message file—Input.xml —opens in the editor.In the Input.xml file,modify the <hel:name>?string?</hel:name>line to <hel:name>John Smith</hel:name>The Input.xml file should be:<soapenv:Envelope xsi:schemaLocation="/soap/envelope//soap/envelope/"xmlns:xsi="/2001/XMLSchema-instance "xmlns:xsd="/2001/XMLSchema "xmlns:soapenv="/soap/envelope/"xmlns:hel="/schema/HelloXSLTIncoming "><soapenv:Body><hel:name>John Smith</hel:name></soapenv:Body></soapenv:Envelope>Click the Save All button on the toolbar.The Output node under the test case node refers to the expected reply message that is used for comparison with the actual reply messages.Before we run the test for the first time,the Output.xml file is empty.The first test run will populate Output.xml with the real output.Subsequent test runs will compare the real output against the content ofOutput.xml 678Performing aTest Run of the XSLTransformation Service▼To Test the Application:Right-click the JohnSmith node and select Run.Notice that the test fails and the followingdialog box appears:ClickYes.Notice that the failed test node appears below the Output node.Double-click the failed test node to see the message that the XSLTransformation Service sentback:<?xml version="1.0"encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="/soap/envelope/"xmlns:xsd="/2001/XMLSchema "xmlns:xsi="/2001/XMLSchema-instance "xsi:schemaLocation="/soap/envelope//soap/envelope/"xmlns:ns="/schema/HelloXSLTOutgoing "><SOAP-ENV:Header/><SOAP-ENV:Body><ns:greeting xmlns:ns="/schema/HelloXSLTOutgoing ">Hello John Smith</ns:greeting></SOAP-ENV:Body></SOAP-ENV:Envelope>Notice the line<ns:greeting xmlns:ns="/schema/HelloXSLTOutgoing ">Hello John Smith</ns:greeting>The XSL Transformation Service received the name,concatenated it with the string 'Hello'andsent the replymessage.123Performing aTest Run of the XSLTransformation ServiceRun the test again.The test is marked as passed.You have successfully created,deployed and tested an XSL Transformation Service.Now that you have successfully created the Request-Reply XSL Transformation Service,continue with the Service Bridgetype.4Performing aTest Run of the XSLTransformation Service。
LIGGGHTS_TutorialLIGGGHTS is a simulation code for conducting Discrete Element Method (DEM) simulations of granular materials. Unlike some commercial codes, LIGGGHTS is not driven by a graphical user interface. Rather, the user drives the simulation by assembling a text-based input deck consisting of a series of commands to conduct the simulation. The input deck is read sequentially, so ordering of statements is important.A LIGGGHTS input script typically has four parts:1.InitializationSet the parameters that need to be defined before particles are created2.SetupDefine the material properties, particles, geometry, and particle generation3.Detailed SettingsDefine some settings that correspond to speed and memory utilization, output options, etc.4.ExecutionThe actual run command that executes the simulationNote that there are two basic types of statements in a LIGGGHTS input deck – individual commands and fixes. The individual commands establish basic settings for the simulation, while the fixes are used to set particular aspects of the simulation. Generally, fixes (and a few commands, e.g. region) follow a common structure offix ID group-ID style argsID = user assigned name for the fixgroup-ID = ID of the group of atoms to which the fix is appliedstyle = type of fix being appliedargs = arguments used by a particular style; often consists of a keyword and corresponding valueIn this tutorial, we will step through a few input decks to describe the commands and fixes to run each simulation. This tutorial is not intended to cover all possible situations and commands, but rather, to try to describe some common elements in a LIGGGHTS simulation and to provide a starting point for users to develop their own simulations. For additional or more specific information about options for each statement, please see the documentation.Finally, at the end of this report, we provide some ‘best practices’ that have been collected over the past few years to try to help the reader avoid some common mistakes and to achieve the maximum performance out of the simulation.Example 1 – Bin flowA cylindrical hopper was initially filled with a set of spherical particles which were allowed to settle under the influence of gravity. The bottom of the hopper was then opened and the material was allowed to pour from the hopper.Example 2 – Continuous Blending MixerA continuous blending mixer is simulated in which a stream of particles enters at one end and is continuously blended as it travels down the length of the bed before discharging through a chute at the other end of the unit. We consider different feed rates and different impeller rotation rates. Material is fed into the simulation via a constant mass flowrate stream at one end of the unit, and is removed through a chute at the other end.Example 3 – Couette cylinderA Couette cylinder with axial flow, based on work by Kheiripour et al1, is depicted in the figure below. The device is intended to look at the rheological behaviour of a granular flow and to permit study of the tendency for material to segregated based on particle size. In these simulations, we have randomly inserted two different particle sizes (particles are otherwise identical) over a one second interval. The stopper at the bottom of the hopper is then pulled and material flows through a periodic z-boundary condition to flow back into the top of the unit. In doing so, the net mass in the system remains constant. Simultaneously, the drum in the center of the unit rotates about its axis, setting up a shearing action inside the cylinder.1Study of powder flow patterns in a Couette cell with axial flow using tracers and solid fraction measurements, M. Kheiripour Langroudi, P. R. Mort, Gi. I. Tardos, Granular Matter, Oct 2011, Vol 13, Iss 5, pp 541-552# Gravityfix grav all gravity 9.81 vector 0.0 0.0 -1.0# Timesteptimestep 0.00000625# Thermodynamic output settingsthermo_style custom step atoms ke cputhermo 8000thermo_modify lost ignore norm no# Check timestepfix timecheck all check/timestep/gran 1 0.01 0.01run 1unfix timecheck# Dump output#dump dmp all custom 16000 dump.1 id type type x y z ix iy iz vx vy vz fx fy fz & omegax omegay omegaz radius#dump dumpstl all stl 16000 dump*.stl#dump dmp2 all custom 16000 dump.txt type x y z radius### Execution and further settings# Run 1.0 sec to insert and settle particlesrun 160000 upto# Remove the stopper and start the rotationunfix geometryfix geometry all wall/gran/hertz/history mesh n_meshes 3 meshes cad1 cad2 cad3 & rolling_friction cdtfix movecad all move/mesh mesh cad2 rotate origin 0. 0. 0. axis 0. 0. 1. period 1. # Run 30 secrun 4800000Example 4 – 1-Way Flow CouplingA narrow slot is filled by a stream of particles falling near one side, with the flow passing across a narrow jet of air. The air stream causes the particles to blow towards the opposite end of the slot and creates a pile against the far wall.In this example, we’ve designed the stream force to be added via the ‘fix addforce’ command. Using this command, we have designated a small region of space immediately below the inlet stream of particles that causes all particles that enter the region to experience a body force that pushes them laterally. While we’ve used a simple constant force in this example, it is also possible to use variable quantities for the force to represent more complicated flow fields. In addition, the force can be applied to certain groups of particles.While this flow treatment is obviously reduced in fidelity from a truly coupled CFD-DEM simulation, it does provide a simple way to at least include some influence of an external flow field. Thus, for situations in which the particles do not significantly alter the flow field, we can use CFD to determine the flow field in the absence of the solid phase, and then apply this flow field to the DEM simulations to better understand the actual particle dynamics. One could envision using this to model the segregation due to drag forces acting on different sized particles.timestep 0.00001# Thermo settingsthermo_style custom step atoms ke cputhermo 10000thermo_modify lost ignore norm nocompute_modify thermo_temp dynamic yes# Run 1 step to check timestep and initializefix ctg all check/timestep/gran 1 0.01 0.01run 1unfix ctg# Dump particle positionsdump dmp all custom 100 dump.1 id type type x y z ix iy iz vx vy vz fx fy fz & omegax omegay omegaz radius### Execution and further settings# Run remainderrun 200000 uptoExample 5 – Shear CellThis simulation is designed to highlight the use of the servo-controlled wall, in which a geometric construct can move in response to a collision with a particle. Typical walls in a DEM simulation are assumed to be immune to the influence of particle impacts, and so wall motions must be completely prescribed. Using the servo wall allows us to consider additional systems, such as the shear cell shown here, in which the wall position is determined by a combination of a subjected load and impacts with the particles.An annular ring was initially filled with two sets of spherical particles (red = 4 mm diameter and blue = 6 mm) which were allowed to settle under the influence of gravity. The particles were filled sequentially with the larger blue particles on the bottom, followed by the red particles on top. After the cell is filled, an annular lid is lowered onto the top of the cell and held with a load on top. The lid is allowed to move in the z-direction in response to stresses imparted by the particles and the load on top. Once the lid has been placed, the bottom of the ring is slowly rotated to create a shear field and instigate segregation. Once the shearing action starts, the smaller particles percolate down through the layer of larger particles, causing the material to vertically segregate.Best PracticesStabilityKeep the timestep below 20% TR for stability. Use the fix_check_timestep_gran to ensure that your timestep is not too large.Use ‘thermo modify lost ignore’ for continuous processes in order to allow the simulation to ignore particles that leave the simulation domain. Otherwise, the simulation will shut down once the firstparticle is lost.In conjunction with the previous note, do not ignore lost particles for batch processes as a lost particle is an indication that the simulation isn’t stable.Pay attention to the kinetic energy and cpu time in your thermo output.o If the kinetic energy is jumping about violently, it is an indication that the timestep may be too large. This could result in a particle deeply penetrating another body during the course of onetimestep, resulting in a huge repulsive force and high corresponding kinetic energy in the nextstep.o The cpu time per step should remain fairly constant when at equilibrium, and should follow a fairly smooth progression when filling a system. If the time/step suddenly starts to increasedramatically during filling, it is an indication that something is blocking the feed zone andpreventing you from achieving the desired fill rate. This may also manifest as warnings thatfewer particles were inserted than desired.Particle generationIf you see warnings that the simulation was unable to insert the desired amount of particles, it is an indicator that you are trying to feed too aggressively. To counter this, either (1) decrease the feed rate,(2) increase the size of the insertion zone, or (3) increase the initial velocity of the particles so they clearthe zone more quickly.o The insertion zone is often limited by the size of the geometry. In cases where it is not, it can sometimes be tempting to enlarge the zone dramatically to ease particle insertion. However,this can cause two problems. First, if the zone is large in the direction of gravity, particles mayaccelerate to sufficiently high velocities so as to cause stability problems where a particle willimpact another body at too high of a speed to be handled by the base timestep. Second, it mayforce you to expand the domain of the simulation, which can slow the simulation down(depends on processor assignment).o Setting the initial velocity too high can lead to stability problems as described above.If the simulation initially inserts particles without issue, but then starts to suffer problems where it is unable to insert the desired number of particles, it is an indication that something is now obstructing the insertion zone. Most likely is that the previously inserted mass has backed up or formed a pile that isnow intruding into the insertion zone.It is generally a good idea to make sure a batch system is fully enclosed so as to avoid losing particles during the simulation. However, the presence of a lid can limit the ability to insert particles. If the lid is inserted as a separate object, it can be moved about before and after the particle insertion to facilitate the filling operation, or simply added to the system afterall particles have been added.Using different material types for different groups of particles, even if all of the material properties are identical, can be a convenient way to identify particles and groups of particles during post-processing.This is especially true for mixing problems.Of the three insertion methods (pack, rate/region, and stream), it is recommended to use the rate/region or stream methods. The pack method relies on being able to fill a volume with a largenumber of particles at one time via random sequential addition, which will typically fill a volume to no more than 30%. This can make it difficult to achieve the desired number of particles and will often leavea large empty space in the simulation domain that reduces the efficiency of parallelization. Using therate/region or stream options allows you to use a much smaller insertion volume and insert materialover time. Rate/region is preferred in general over stream solely because the user can define theinsertion region from within the input deck and does not require the user to create and import some external CAD. That said, sometimes (e.g. filling an annular ring) is accomplished far more efficiently with the rate/stream option.GeometryUse a simple mesh, even w/ high-aspect ratio triangles. Tests thus far indicate no difference in accuracy of results (disclamer – more testing is needed here, especially for stress calculations!) between using a coarse mesh as generated directly from a CAD program, and using a fine mesh as generated by a toolsuch as gmsh.o The high-aspect ratio triangles may diminish the ability to parallelize the geometry, but if there are significantly fewer facets than a fine description, you may end up saving more time in thelong run. In many simulations, the number of particles will far exceed the number of facets inthe geometry, and so parallelizing the geometry isn’t as critical.Simplify the geometry to avoid including parts that will never touch the particles (e.g. the motor that drives a mixer). Simplify geometry to avoid very small curved surfaces if possible. These may end up using a lot of facets that aren’t really that important.Keep in mind that gravity doesn’t always have to point down.Speed-upsKeep the domain size as small as possible without losing geometry. This will avoid wasting processing power on empty space.Pay attention to the processor distribution. For many systems, you can take advantage of knowing where your particles will be during the simulation to assign processors in an advantageous way andenhance the speed of the simulation. For example, if you have a batch mixer where the particles aregently mixed and generally occupy only the lower half of the mixer volume, using two processors in the z-direction results in the top-most layer of processors doing very little work and not being usedeffectively. Using a single layer in the z-direction instead will lead to a significantly faster simulation.In the absence of testing, set the skin size for neighbor list calculations to ~ 1 particle diameter. Setting the neighbor list skin size too small leads to overly frequent recalculations of the neighbor list, whilesetting it too large leads to huge memory requirements. The optimal setting is a balance between the two and depends on the size of the particles, the density of the system, and the speed at which particles are moving about. A single guideline for all cases is thus difficult to set, and ideally some testing should be done to optimize the simulation.Adjust physical properties as possible for speed. For example, modulus can often be set much lower than realistic values, yielding a significant speedup, without impacting the overall simulation results.Typically, setting the elastic modulus to ~107 Pa is sufficiently high so as to capture the basic particledynamics. Increasing the density also has a positive effect by allowing for a larger timestep, thoughtypically we are not able to alter density by as much as an order of magnitude.Visualization/post-processingYou can export the geometry in multiple sets of dump files to facilitate visualization by allowing you to set the transparency on a per-body basis.You can use multiple particle types, even if they all have the same material properties, to help with post-processing elements. For example, when considering the performance of a mixer, having two particle types, with one type fed to each side of the mixer, it becomes trivial to visualize mixing performance as you can color by particle type. You can also calculate quantities like a mixing index based on particletype.。
SonarWiz SEG-import and SEISEE TutorialRevision 12.0, 1/22/2019Chesapeake Technology, Inc.eMail: **************************Main Web site: Support Web site: 1605 W. El Camino Real, Suite 100Mountain View, CA 94040Tel: 650-967-2045Fax: 650-450-9300Table of Contents1SEISEE Tutorial (2)1.1References (3)1.2SEISEE – Basic Usage Ideas (3)1.3SEISEE – Changing Trace Header Data (5)1.3.1CHANGE - Individual Field Changes (5)1.3.2CHANGE - Changing the Value for an Entire Column (6)1.3.3EXPORT-IMPORT - Changing Multiple Columns at a Time (9)1.4SEISEE – Changing EBCDIC Text Header Data (9)2SonarWiz SEG Import - using SEISEE for file review (12)2.1Required Trace Header Data for SEG File import (12)2.1.1Requirement 1: Valid Date/Time Data (12)2.1.2Requirement 2: Valid Navigation Data (14)2.1.3Requirement 3 – Enough Navigation Data (19)2.1.4Requirement 4: Project Loc = Coordinate System = Navigation Data (21)2.1.5Requirement 5: Sequential ping numbers (23)2.2Channels Count (#Data Traces Per Record) Requirement (25)3SonarWiz TRA File Import - using SEISEE for file review (27)4SonarWiz Sub-bottom 6.04 / 6.05 Special Import Techniques (30)5SEG ReTIME Tips for Exceptionally Slow Ping-Rate (32)1 SEISEE TutorialSEG is a common import format used for sub-bottom files, in SonarWiz post-processing. This document describes techniques for success in two areas:1) Viewing and repairing trace headers of SEG files with the SEISEE utility software,and2) Importing SEG files successfully into SonarWiz.We use the free utility SEISEE, for viewing and editing SEG-Y type files which may need analysis or repair, as a supplementary technique, in addition to the standard SonarWiz file-repair utility NavInjectorPro.The free SEISEE utility is available here:Web-site http://www.dmng.ru/seisview/ has a 4.8 MB self-extracting archive file at no cost. Current version was 2.1.5.4 (8/2010).1.1 ReferencesSEISEE displays and edits, and SonarWiz creates and imports, SEG files in accordance with this specification reference:Ref[1]: SEG_Y_FileFormatSpec2002_rev1.pdf, Release 1, May, 20021.2 SEISEE – Basic Usage IdeasSEISEE has an excellent HELP facility, so use that as your first recourse when trying to understand the program better.Primary viewing steps are to select File->Open and open your SEG file, then perhaps select SEISMIC and VIEW tabs, to see the data.A secondary look is TRACE HEADERS and VIEW tabs selected. In this view, you simply check what SEG file trace header fields to view.The main fields to look for in validating good data for import to SonarWiz or some other program are typically date, time, and navigation. Just look at those columns and see if any are all zeros … which would be a problem.1.3 SEISEE – Changing Trace Header DataYou can easily edit the SEG trace headers data by changing the values for an individual field, an entir e column, or multiple columns at a time. Here’s how to do it.1.3.1 CHANGE - Individual Field ChangesExport the data containing the columns where you want to make an edit, then use WORDPAD (recommended) to make changes to individual field values and re-import. Note that your SEG file cannot be READ-ONLY for this operation to work.1.3.2 CHANGE - Changing the Value for an Entire ColumnNote that your SEG file cannot be READ-ONLY for this operation to work.To change the value of SAMPLE INTERVAL, for example, for an entire column, first select CHANGE (1), then enter the column name = <new value> (2) then click the (3) Update iucon:In some versions of SEISEE this will appear as 4 steps instead of 3 steps:Select CHANGE and then check (enable) a single field, like bytes 117-118 Sample interval.Enter a new value (e.g. UNITS=75) to change every 25 to a 75 in all trace headersClick on the UPDATE iconClick on UPDATE to conclude it and make the change. Results:In the case of changing UNITs=1 to UNITS=2, the results look like this:1.3.3 EXPORT-IMPORT - Changing Multiple Columns at a TimeTo change one or more columns in an easy custom batch-change, useEXPORT/IMPORT technique, like this:Select some columns to VIEW, then use File->Export Trace Headers to export them and create a CSV file, then edit that in EXCEL or manually or via a script. The export CSV file will have a header line (keep that) and the trace header data itself in comma-separated-values format. Finally re-import the changed data file using File->Import Trace Headers.1.4 SEISEE – Changing EBCDIC Text Header DataYou can easily edit the SEG EBCDIC text headers data by changing the values for an individual line at a time. Here’s how to do it.1. Open your SEG file and in the summary area, select TEXT HEADER to see the existing text header:2. Type in a new line, for example this replacement of the line at C 4:2 SonarWiz SEG Import - using SEISEE for file reviewSEISEE can be used to supplement viewing of the SEG file internals, to help investigate situations where, for example, the SonarWiz error message says“No valid navigation data was extracted from: <file name>”.What’s up with that? Here’s how to find out.2.1 Required Trace Header Data for SEG File importGenerally speaking, you need valid data and time stamps, and navigation in the SEG file trace headers, and enough of it, to successfully import the SEG file into SonarWiz. These 3 requirements are explained in more detail below.2.1.1 Requirement 1: Valid Date/Time DataViewing the columns of SEISEE data, if you enable the date and time fields, look for a valid current date, and times with valid values and sequentially incrementing values, as pings (records) proceed into the file, rather than ZERO or NON-INCREMENTING or OUT-OF-SEQUENCE values.Good data might look like this, with valid values for year, day, hour, minute, and incrementing values for SCE (seconds) – in this case about 3 hz ping rate.If any of these columns is all zero, missing data, out of sequence … import may not work well.2.1.2 Requirement 2: Valid Navigation DataThere are 4 columns of navigation data, and at least 2 of these need to contain valid data for import to succeed:The SRCX/SRCY and GRPX/GRPY represent X/Y, or Easting/Northing. OrLat/Long,and may be coded in meters or arcseconds (you need a valid value, and a valid UNITS code), according to the SEG File Specification we use. In SonarWiz, these SEG trace header fields are interpreted like this:When you will be importing SEG files, in your CREATE PROJECT or CONFIGURE EXISTING PROJECT dialog you can select FISH (source) or SHIP (receiver) coordinates as the source of navigation data, or AUTO – to let SonarWiz decide which seems populated in the file (in case only one exists):You make this choice in the CREATE PROJECT or CONFIGURE EXISTING PROJECT dialog here:So you can see how this would mess up. If you did not specify AUTO, and instead specified FISH, and the only valid data in the SEG file was in the SCRX/SRCY columns, and GRPX/GRPY contained all-zero … it wo uld not import.Al so … e ven though you specify this at the project level, you might override it at the file import level by selecting in SEG File-Type-Specific-Options to read from Source (ship, aka Srcx/Srcy in the SEG trace header) or Receiver (Fish, aka Grpx/Grpy in the SEG tracer header) coordinates, so be sure to check this too:Again, it’s only really going to be a problem if 2 of the columns are all-zeros in your SEG file trace headers, and you selected those as the navigation source – in which case the file will not import well.Here is an example of a SEG file with ONLY SRCX/Y coordinates, so it would be best imported using SHIP or AUTO navigation source choice in the CREATE PROJECT dialog, and SOURCE COORDS for navigation source, in the SEG File-Type-Specific-Options dialog:2.1.3 Requirement 3 – Enough Navigation DataThe third requirement is that you have enough pings in the file to process. When you create a project, you may specify the minimum ping count and not realize it. Setting this value means you have to have at least that many pings in the file, or it will not import. The field which identifies this is called “Time Constant for Course Smoothing”, set in the CREATE or CONFIGURE EXISTING project dialogs:The valid values here range from 3 – 1200 with a default value of 300 pings. You can see that if you specify 300 pings for smoothing, and the file contains only 299 pings –well there you go – it will not import. It really helps smooth presentation of your file to smooth, but set a minimal value like 3 pings for a very small SEG file. 300 pings is a fine value for larger files. You can adjust this value at any time and then re-import your files. NOTES:(1) In 5.08.0002 and later releases, an enhancement is implemented which allows SonarWIz to temporarily relax the TC for Course Smoothing size down to the number of pings in your input file, just to import that (small) file successfully.(2) In current versions of SonarWiz, since July, 2016, the ability to relax Time Constant for Course Smoothing entirely and set TC=0 is available. This allows you to NOT SMOOTH the incoming navigation at all.2.1.4 Requirement 4: Project Loc = Coordinate System = Navigation DataThis section explains how a mismatch in any of 3 features if the import can cause an import failure.2.1.4.1 Setting project Location – Manually or via GET FROM FILEIn the CREATE PROJECT and CONFIGURE EXISTING PROJECT dialogs, a great way to validate navigation data in the file, and set project location (latitude, longitude) at the same time is use of the GET FROM FILE button:If we browse to the SampleRawSonarFile.SEG in this case and select it, the project location is set as 40 N latitude, 73 E longitude. Also, SonarWiz autiomatically selected the coordinate system to match this location (UTM84-43N).2.1.4.2 SEISEE View of Project Location (Navigation Data in Trace Headers)In the SEISEE view of the coordinates in the trace header, this project shows like this:The SAC column is a scalar and -100 means divide the coordinate units by 100.The coordinates are encoded in arcseconds (1 arcsecond = 1/3600 degree) as specified in the last co,umn, UNITS=2. The meaning of the data in each field can be seen in the SEGY File Specification (ref[1]).In this example 1, let’s convert the SRCX value 26,623,709 arcseconds to degrees by dividing by 3600 and then dividing by 100 = 73.95 deg E longitude. If it were W longitude, it would be a negative number (e.g. -26,623,709 = 73.95 deg W longitude).Likewise we can convert SRCY value 14,519,374 arcseconds / 360000 = 40.33 deg N latitude. If it were S latitude, it would be a negative number (e.g. -14,519374 = 40.33 deg S latitude)2.1.4.3 Import example1: Position Matches Lat/Long & Coordinate SystemIn this example, coordinate system UTM84-43N was used, and project location was set to latitude = 40.33 deg N, longitude =- 73.95 deg E, and the navigation data in the file matches these, so the import succeeded.2.1.4.4 Import example2: Position Does Not Match Lat/Long & Coordinate System In this example 2, we leave project location set to latitude = 40.33 deg N, longitude = 73.95 deg E, and the navigation data in the SEG file has not changed, but we set the coordinate system MANUALLY to UTM-84-18N (the western counterpart to zone 43N) . In this case, the import will fail and give these messages in the SYSTEM OUTPUT window:So the import will appear to fail, even though there is valid navigation data in the file, simply because all 3 need to match. A mismatch of any one of these 3 cal cause the import to fail:Navigation data in fileProject locationCoordinate systemTry this yourself with any valid file, and see how easy it is to set a coordinatesystem or project location wrong (e.g. specifying UTM84-43S with this data) and getting the import error.2.1.5 Requirement 5: Sequential ping numbersThe SEG file needs to have sequential ping numbers to import and display properly, and these are referred to as a "shot number" in the SEG "FileTypeSpecificOptions ..." settings.Often the TRACE NUMBER (SEQWL) is a sequential value, and this trace header position bytes 1-4 is used by default in SonarWiz 5:In the SEG File Type Specific Options settings, you see a reference to this here:If your file imports VERY slowly, and will not display properly in the DigitizerView, chances are you will need to re-select the ping number (shot number) from one of the other 2 choices available, like this:Here's an example file where we need to read ping number from the FFID field in byte positions 9-12, since SEQWL was used for channel number 0,1,2,0,1,2 instead:The 3-channel storage of the data is read properly by choosing the valid FFID, instead of SEQWL for the ping number, in this case:Check your trace header data with SEISEE yourself, if you are have an extremely slow or incorrect DigitizerView display of your SEG file.2.2 Channels Count (#Data Traces Per Record) RequirementFor 1-channel data, the channels count (# data traces per record) = 1 is necessary in binary header bytes 13-14. An invalid channels count like 60 will appear like this in a SEISEE view of the BINARY HEADER:A SonarWiz 7 error will occur if the channels count (# data traces per record) is invalid (very typically you expect 1 or 2-channel data, so the valid values are likely 1 or 2). With a value = 60 there, this is the error you get:Using SEISEE, just select the ability to EDIT the binary header and enter the correct channel count in the bytes 13-14 position like this:The file saves immediately with the change (in older versions of SEISEE, select UPDATE then OK, to save). Reopen the file to verify it is you want to confirm that the change was saved.3 SonarWiz TRA File Import - using SEISEE for file reviewTRA files are a special category of SEG file. They have the TRA extension, but are a form of SEG file.Some have poor formatting, such as missing navigation in early pings, missing year or day, things we normally expect in a SEG file, but even after simple repairs to a file, it can seem tricky to import. Here are some import tips that worked in the past.Main import dialog:(1) select NEGATIVE polarity, BIPOLAR type, Channel 1(2) File Type Specific OptionsSelect SHOT NUMBER from bytes 9-12Select SOURCE coordinatesWhen the file has imported, apply AGC and band-pass filtering as follows:The APPEARANCE settings to try:(1) NEGATIVE polarity(2) TOPO correction OFFGAIN SETTINGS to apply:(1) AGC ON - try resolution=30 Intensity = 25(2) BAND-PASS filtering - enable and tryLF = 300 hzHF = 2500 hzNum Taps = 50Type = BARTLETTApply gain starting at TIME ZERO.4 SonarWiz Sub-bottom 6.04 / 6.05 Special Import TechniquesWe have an entire PDF reference dedicated to explaining these new options, but we will summarize them here:(1) Since SonarWiz 6.04, the data polarity choice during sub-bottom import has become essential to set properly, in order to import your data and see it well. See the special PDF document referenced below, for advice about seeing which type of SEG file data you have - bipolar or unipolar.(2) Since SonarWiz 6.04.0014, the Color Windows technique for choosing your color palette, and setting the color-mapping by using the "SCALE TO DATA" button of the color window, has become essential. See the special PDF document referenced below, for advice about use of the color window.(3) Since SonarWiz 6.05.0002, the import data format of your sub-bottom files, inside SonarWiz, changed for the better. In 6.05.0001 and earlier, the CSF-file encoding of sub-bottom amplitudes were 8-bit bytes with a 0-255 scale, and your import techniques were used to map file data into this internal format. In 6.05.0002, the internal representation format of sub-bottom data because 16-bit floating-point database format. This means that it is not compatible with previous versions of SonarWiz, and when you open a project of say, imported SEG data, in 6.05.0002, if it had been imported using a previous version of SonarWiz, the CSF feil forma will "promote" to 6.05.0002 format.A second result is that some file import settings are not only unnecessary (e.g. gain x2, x4 etc), but they will have no effect, in 6.05.0002 and beyond, because they were only needed for encoding the SEG data into 8-bit bytes in the CSF file. The color-window and the histogram adjustment of the color window become essential to use for SEG file import in 6.05.002 and later versions.See the special PDF document referenced below, for advice about use of the color window and histogram.Special reference for 6.04 / 6.05 sub-bottom data import and display (already on your hard drive)Or find it in the SonarWiz downloads area of here: 6.04 / 6.05 sub-bottom import advice:/download/ctisupport/Sonarwiz_6/UserDocs/Sub-bottomImport_6.04_6.05_Advice.pdf5 SEG ReTIME Tips for Exceptionally Slow Ping-RateExceptionally slow ping-rate files can be a special case to manage inTOOLS -> SEG -> SEG-Y File Retime:If you do not have a "normal" ping-rate like 0.5 Hz - 5Hz but have a very slow file like 5-secs - 12 secs or more per ping, use a subtractive technique to create a 0.5 - 1.0 Hz ping-rate like this:(1) Compute the nominal inter-ping-time by multiplying sample interval x sample count - like in this example 4000 msec x 3000 sample = 12 seconds.(2) Then to create a 0.5 Hz ping rate (time changes 2 secs per ping), use -10000 as the inter-ping adjustment time like this:You are subtracting 10 secs per ping to create a nominally "normal" inter-ping time (2 secs) , to help avoid triggering inter-ping-time error thresholds during SonarWiz 7 import.。
Things to Know Before Getting Started with eQUEST Whole building analysis. eQUEST is designed to provide whole Building performance analysis to buildings professionals, i.e., owners, designers, operators, utility & regulatory personnel, and educators. Whole building analysis recognizes that a building is a system of systems and that energy responsive design is a creative process of integrating the performance of interacting systems, e.g., envelope, fenestration, lighting, HVAC, and DHW.在开始之前需要知道的事情与eQUEST关于整个建筑的分析。
eQUEST旨在提供整个建筑性能分析建筑专业人士,即所有者,设计师、运营商、实用工具和监管人员,和教育家。
从整个建筑分析认识到建筑是一个系统的系统和能量响应设计是一种创造性的整合过程性能交互的系统,例如,维护结构、开窗、照明、空调和DHW。
Therefore, any analysis of the performance consequences of these building systems must consider the inter actions between them … in a manner that is both compre hensive and affordable (i.e., model preparation time, simulation runtime, results trouble shooting time, and results reporting).因此,任何分析的性能影响这些建筑系统必须考虑…它们之间的交互的方式,既全面和负担得起的(例如,模型的准备时间,模拟运行时间,结果故障排除时间,和结果报告)。
1) Explain what is SQLite?SQLite is a mostly ACID compliant relational database management system contained in a relatively small C programming library.2) List out the standard SQLite commands?The standard SQLite commands interact with relational databases are similar to SQL. They are •SELECT•CREATE•INSERT•UPDATE•DROP•DELETEBased on their operational nature these commands can be classified.3) Explain what is SQLite transactions?The transaction is referred as a unit of work that is performed against a database. It is the propagation of one or more changes to the database. Properties of transactions are determined by ACID.•Atomicity: It ensures that all work unit are successfully completed•Consistency: It ensures that the database changes states upon a successfully committed transaction•Isolation: It enables transactions to operate independently of and transparent to each other•Durability: It ensures that the result or effect of a committed transaction persists in case ofa system failure4) List out the areas where SQLite works well?SQLite works well with•Embedded devices and the internet of things•Application file format•Data Analysis•Websites•Cache for enterprise data•Server side database•File archives•Internal or temporary databases•Replacement for ad hoc disk files•Experimental SQL language extensions•Stand-in for an enterprise database during demos or testing 5) What is the difference between SQL and SQLite?•SQL is a Structured Query Language •SQLite is a powerful, embedded relational database management system mostly used in mobile devices for data storage•SQL is server based •SQLite is file based6) List out the advantages of SQLite?•It does not require separate server processor system to operate•No setup or administration required SQlite comes with zero-configuration•An SQLite database can be stored in a single cross-platform disk file•SQLite is very compact less than 400 KiB•SQLite is self-contained, which means no external dependencies•It supports almost all types of O.S•It is written in ANSI-C and provides easy to use API7) Mention what are the SQLite storage classes? SQLite storage classes include•Null: The value is a NULL value•Integer: The value is a signed integer (1,2,3, etc.)•Real: The value is a floating point value, stored as an 8 byte IEEE floating point number •Text: The value is a text string, stored using the database encoding ( UTF-8, UTF-16BE) •BLOB (Binary Large Object): The value is a blob of data, exactly stored as it was input8) Explain how Boolean values in SQLite are stored?Boolean values in SQLite are stored as integers 0 (false) and 1 (true). SQLite does not have a separate Boolean storage class.9) Explain what is the use of SQLITE group by clause?The SQLITE group by clause is used in collaboration with the SELECT statement to arrange identical data into groups.10) Mention what is the command used to create a database in SQLite?To create a database in SQLite- command “sqlite3” is used. The basic syntax to create a database is $sqlite3 DatabaseName.db.11) Mention what is .dump command is used for?The .dump command is used to make an SQLite database dump, remember once you use the dump command all your data will be dumped forever and cannot be retrieved.12) Explain how can you delete or add columns from an existing table in SQLite?There is a very limited support for alter ( add or delete ) table. In case if you want to delete or add columns from an existing table in SQLite you have to first save the existing data to a temporary table, drop the old table or column, create the new table and then copy the data back in from the temporary table.13) Mention what is the maximum size of a VARCHAR in SQLite?SQLite does not have any specific length for VARCHAR. For instance, you can declare a VARCHAR (10) and SQLite will store a 500 million character string there. It will keep all 500 characters intact.14) Mention when to use SQLite and when not to use SQLite?SQLite can be used in following conditions•Embedded applications: Does not require expansion like mobile applications or games •Disk assess replacement: Application that require to write or read files to disk directly •Testing: When testing business application logicWhen not to use SQLite•Multi-user applications: Where multiple client needs to access and use same database •Applications requiring high write volumes: It enables you to use only one single write operation to take place at any given time15) Explain how to recover deleted data from my SQLite database?To recover the information you can use your backup copy of your database file, but if you do not have a backup copy, then recovery is impossible. SQLite uses SQLITE SECURE DELETE option which overwrites all deleted content with zeroes.16) When can you get an SQLITE_SCHEMA error?The SQLITE_SCHEMA error is returned when a prepared SQL statement is not valid and cannot be executed. Such type occurs only when using the sqlite3 prepare() and sqlite3 step() interfaces to run SQL.17) Mention what is the Export Control Classification Number (EECN) for SQLite?The core public domain SQLite source code is not described by any ECCN. Hence, the ECCN should be reported as EAR99. But if you are adding new code or linking SQLite with the application, then it might change the EECN number.18) Explain what is view in SQLite?In SQLite, a view is actually a composition of a table in the form of pre-defined SQLite Query. A view can consist of all rows of a table or selected rows from one or more tables.19) Explain what are SQLite Indexes?SQLite indexes are special lookup tables that the database search engine use to speed up data retrieval. In simple words, it is a pointer to data in a table.20) When Indexes should be avoided?Indexes should be avoided when•Tables are small•Tables that changes frequently•Columns that are frequently manipulated or having a high number of NULL valuesGuru99 Provides FREE ONLINE TUTORIAL on Various courses likeSAP Training Python Excel ASP Net HBaseProjectTest Management Business Analyst Ethical Hacking PMP ManagementLive Project SoapUI Photoshop Manual Testing Mobile Testing Data Warehouse R Tutorial Tableau DevOps AWSSoftware Jenkins Agile Testing RPA JUnitEngineering Selenium CCNA AngularJS NodeJS PLSQL。
maven项⽬执⾏main⽅法讲解项⽬中有时候会遇到执⾏main函数来测试类中所写的⽅法。
普通的java程序在eclipse中执⾏⾮常简单,对要执⾏的java类,run as 即可编译运⾏,查看结果。
但是使⽤maven管理项⽬,对于maven项⽬还按照原来的⽅式就⾏不通了。
下⾯讲解下如何在maven项⽬中执⾏main函数。
⼀、 maven项⽬执⾏main函数⽅法,需引⼊两个插件:maven-compiler-plugin和exec-maven-plugin插件。
maven-compiler-plugin :⽤于编译java⽂件exec-maven-plugin:⽤来执⾏class⽂件,其中插件配置中需指明执⾏类的路径。
具体引⼊,参考maven项⽬中的pom.xml⽂件配置。
1 <project xmlns="/POM/4.0.0" xmlns:xsi="/2001/XMLSchema-instance" xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.0.xsd">2 <modelVersion>4.0.0</modelVersion>3 <groupId>com.hik.shiro.tutorial</groupId>4 <artifactId>shiro-tutorial</artifactId>5 <version>0.0.1-SNAPSHOT</version>6 <name>First Apache Shiro Application</name>7 <description>First Apache Shiro Application</description>89 <properties>10 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>11 </properties>1213 <build>14 <plugins>15 <plugin>16 <groupId>org.apache.maven.plugins</groupId>17 <artifactId>maven-compiler-plugin</artifactId>18 <version>3.6.1</version>19 <configuration>20 <source>1.7</source>21 <target>1.7</target>22 <encoding>${project.build.sourceEncoding}</encoding>23 </configuration>24 </plugin>2526 <!-- This plugin is only to test run our little application. It is not27 needed in most Shiro-enabled applications: -->28 <plugin>29 <groupId>org.codehaus.mojo</groupId>30 <artifactId>exec-maven-plugin</artifactId>31 <version>1.6.0</version>32 <executions>33 <execution>34 <goals>35 <goal>java</goal>36 </goals>37 </execution>38 </executions>39 <configuration>40 <classpathScope>test</classpathScope>41 <mainClass>shiro.Tutorial</mainClass>42 </configuration>43 </plugin>44 </plugins>45 </build>4647 <dependencies>48 <dependency>49 <groupId>org.apache.shiro</groupId>50 <artifactId>shiro-core</artifactId>51 <version>1.2.4</version>52 </dependency>53 <dependency>54 <groupId>org.slf4j</groupId>55 <artifactId>slf4j-log4j12</artifactId>56 <version>1.7.25</version>57 <scope>test</scope>58 </dependency>59 </dependencies>60 </project>View Code配置需注意的地⽅:mainClass ⼀定能跳转到执⾏的类,否则执⾏报错会找不到类。
Solr tutorialTable of contents1 Overview (2)2 Requirements (2)3 Getting Started (2)4 Indexing Data (3)5 Updating Data (4)5.1 Deleting Data (5)6 Querying Data (5)6.1 Sorting (6)7 Highlighting (6)8 Faceted Search (7)9 Search UI (7)10 Text Analysis (7)10.1 Analysis Debugging (8)11 Conclusion (9)Copyright © 2007 The Apache Software Foundation. All rights reserved.1 OverviewThis document covers the basics of running Solr using an example schema, and some sample data.2 Requirements3 Getting StartedPlease run the browser showing this tutorial and the Solr server on the same machine so tutorial links will correctly point to your Solr server.Begin by unziping the Solr release and changing your working directory to be the "example" directory. (Note that the base directory name may vary with the version of Solr downloaded.) For example, with a shell in UNIX, Cygwin, or MacOS:user:~solr$ lssolr-nightly.zipuser:~solr$ unzip -q solr-nightly.zipuser:~solr$ cd solr-nightly/example/Solr can run in any Java Servlet Container of your choice, but to simplify this tutorial, the example index includes a small installation of Jetty.To launch Jetty with the Solr WAR, and the example configs, just run the start.jar ... user:~/solr/example$ java -jar start.jar2009-10-23 16:42:53.816::INFO: Logging to STDERR via org.mortbay.log.StdErrLog2009-10-23 16:42:53.907::INFO: jetty-6.1.26...Oct 23, 2009 4:41:56 PM org.apache.solr.core.SolrCore registerSearcherINFO: [] Registered new searcher Searcher@7c3885 mainThis will start up the Jetty application server on port 8983, and use your terminal to display the logging information from Solr.Copyright © 2007 The Apache Software Foundation. All rights reserved.Page 24 Indexing DataCopyright © 2007 The Apache Software Foundation. All rights reserved.Page 35 Updating DataCopyright © 2007 The Apache Software Foundation. All rights reserved.Page 4Page 5Copyright © 2007 The Apache Software Foundation. All rights reserved.6 Querying DataPage 6Copyright © 2007 The Apache Software Foundation. All rights reserved.7 Highlighting8 Faceted Search9 Search UI10 Text AnalysisText fields are typically indexed by breaking the text into words and applying various transformations such as lowercasing, removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.Copyright © 2007 The Apache Software Foundation. All rights reserved.Page 7Page 8Copyright © 2007 The Apache Software Foundation. All rights reserved.11 ConclusionCopyright © 2007 The Apache Software Foundation. All rights reserved.Page 9。
Swagger⼊门教程[译]5.41 Swagger tutorial更多概念参见:关于 SwaggerSwagger能成为最受欢迎的REST APIs⽂档⽣成⼯具之⼀,有以下⼏个原因:Swagger 可以⽣成⼀个具有互动性的API控制台,开发者可以⽤来快速学习和尝试API。
Swagger 可以⽣成客户端SDK代码⽤于各种不同的平台上的实现。
Swagger ⽂件可以在许多不同的平台上从代码注释中⾃动⽣成。
Swagger 有⼀个强⼤的社区,⾥⾯有许多强悍的贡献者。
Swagger ⽂档提供了⼀个⽅法,使我们可以⽤指定的 JSON 或者 YAML 摘要来描述你的 API,包括了⽐如 names、order 等 API 信息。
你可以通过⼀个⽂本编辑器来编辑 Swagger ⽂件,或者你也可以从你的代码注释中⾃动⽣成。
各种⼯具都可以使⽤ Swagger ⽂件来⽣成互动的 API ⽂档。
注意:⽤ Swagger ⽂件⽣成互动的 API ⽂档是最精简的,它展⽰了资源、参数、请求、响应。
但是它不会提供你的API如何⼯作的其他任何⼀个细节。
Petstore 的 Swagger 例⼦为了更好的理解 Swagger ,我们现在来探索⼀下 Petsotre 项⽬的例⼦。
记住:以下出现的 UI 都是指Swagger UI。
Swagger 可以被展⽰成不同的视觉样式,这取决于你所使⽤到的视觉框架。
有三个资源:pet,store,user。
创建⼀个 pet1、展开 pet 的 post ⽅法2、然后单击 Model Schema 中的黄⾊字体的 JSON。
这⾥⽤ JSON 填充了 body value。
这⾥的 JSON 是你必须上传的,⽤于创建 pet 资源。
3、将第⼀个 id 标签的值修改⼀下(你必须保证 id 值都是唯⼀的,并且不能从 0 开始)。
4、将 name 标签的值修改⼀下(最好也要唯⼀,⽅便对⽐结果),以下是⽰例代码:{"id": 37987,"category": {"id": 0,"name": "string"},"name": "Mr. Fluffernutter","photoUrls": ["string"],"tags": [{"id": 0,"name": "string"}],"status": "available"}5、单击 Try it out! 按钮,查看响应:通过 ID 查询 pet展开 Get ⽅法:pet/{petId},输⼊你的 petId,单击 Try it out!,你创建的 pet 就会显⽰在 response 中。