| I l@ve RuBoard |
5.5 Visitor: Walking Trees GenericallyArmed with the portable search_all script from Example 5-10, I was able to better pinpoint files to be edited, every time I changed the book examples tree structure. At least initially, I ran search_all to pick out suspicious files in one window, and edited each along the way by hand in another window. Pretty soon, though, this became tedious too. Manually typing filenames into editor commands is no fun, especially when the number of files to edit is large. The search for "Part2" shown earlier returned 74 files, for instance. Since there are at least occasionally better things to do than manually start 74 editor sessions, I looked for a way to automatically run an editor on each suspicious file. Unfortunately, search_all simply prints results to the screen. Although that text could be intercepted and parsed, a more direct approach that spawns edit sessions during the search may be easier, but may require major changes to the tree search script as currently coded. At this point, two thoughts came to mind. First, I knew it would be easier in the long-run to be able to add features to a general directory searcher as external components, not by changing the original script. Because editing files was just one possible extension (what about automating text replacements too?), a more generic, customizable, and reusable search component seemed the way to go. Second, after writing a few directory walking utilities, it became clear that I was rewriting the same sort of code over and over again. Traversals could be even further simplified by wrapping common details for easier reuse. The os.path.walk tool helps, but its use tends to foster redundant operations (e.g., directory name joins), and its function-object-based interface doesn't quite lend itself to customization the way a class can. Of course, both goals point to using an OO framework for traversals and searching. Example 5-11 is one concrete realization of these goals. It exports a general FileVisitor class that mostly just wraps os.path.walk for easier use and extension, as well as a generic SearchVisitor class that generalizes the notion of directory searches. By itself, SearchVisitor simply does what search_all did, but it also opens up the search process to customization -- bits of its behavior can be modified by overloading its methods in subclasses. Moreover, its core search logic can be reused everywhere we need to search; simply define a subclass that adds search-specific extensions. Example 5-11. PP2E\PyTools\visitor.py############################################################# # Test: "python ..\..\PyTools\visitor.py testmask [string]". # Uses OOP, classes, and subclasses to wrap some of the # details of using os.path.walk to walk and search; testmask # is an integer bitmask with 1 bit per available selftest; # see also: visitor_edit/replace/find/fix*/.py subclasses, # and the fixsitename.py client script in Internet\Cgi-Web; ############################################################# import os, sys, string listonly = 0 class FileVisitor: """ visits all non-directory files below startDir; override visitfile to provide a file handler """ def __init__(self, data=None, listonly=0): self.context = data self.fcount = 0 self.dcount = 0 self.listonly = listonly def run(self, startDir=os.curdir): # default start='.' os.path.walk(startDir, self.visitor, None) def visitor(self, data, dirName, filesInDir): # called for each dir self.visitdir(dirName) # do this dir first for fname in filesInDir: # do non-dir files fpath = os.path.join(dirName, fname) # fnames have no path if not os.path.isdir(fpath): self.visitfile(fpath) def visitdir(self, dirpath): # called for each dir self.dcount = self.dcount + 1 # override or extend me print dirpath, '...' def visitfile(self, filepath): # called for each file self.fcount = self.fcount + 1 # override or extend me print self.fcount, '=>', filepath # default: print name class SearchVisitor(FileVisitor): """ search files at and below startDir for a string """ skipexts = ['.gif', '.exe', '.pyc', '.o', '.a'] # skip binary files def __init__(self, key, listonly=0): FileVisitor.__init__(self, key, listonly) self.scount = 0 def visitfile(self, fname): # test for a match FileVisitor.visitfile(self, fname) if not self.listonly: if os.path.splitext(fname)[1] in self.skipexts: print 'Skipping', fname else: text = open(fname).read( ) if string.find(text, self.context) != -1: self.visitmatch(fname, text) self.scount = self.scount + 1 def visitmatch(self, fname, text): # process a match raw_input('%s has %s' % (fname, self.context)) # override me lower # self-test logic dolist = 1 dosearch = 2 # 3=do list and search donext = 4 # when next test added def selftest(testmask): if testmask & dolist: visitor = FileVisitor( ) visitor.run('.') print 'Visited %d files and %d dirs' % (visitor.fcount, visitor.dcount) if testmask & dosearch: visitor = SearchVisitor(sys.argv[2], listonly) visitor.run('.') print 'Found in %d files, visited %d' % (visitor.scount, visitor.fcount) if __name__ == '__main__': selftest(int(sys.argv[1])) # e.g., 5 = dolist | dorename This module primarily serves to export classes for external use, but it does something useful when run standalone too. If you invoke it as a script with a single argument "1", it makes and runs a FileVisitor object, and prints an exhaustive listing of every file and directory at and below the place you are at when the script is invoked (i.e., ".", the current working directory): C:\temp>python %X%\PyTools\visitor.py 1 . ... 1 => .\autoexec.bat 2 => .\cleanall.csh 3 => .\echoEnvironment.pyw 4 => .\Launcher.py 5 => .\Launcher.pyc 6 => .\Launch_PyGadgets.py 7 => .\Launch_PyDemos.pyw ...more deleted... 479 => .\Gui\Clock\plotterGui.py 480 => .\Gui\Clock\plotterText.py 481 => .\Gui\Clock\plotterText1.py 482 => .\Gui\Clock\__init__.py .\Gui\gifs ... 483 => .\Gui\gifs\frank.gif 484 => .\Gui\gifs\frank.note 485 => .\Gui\gifs\gilligan.gif 486 => .\Gui\gifs\gilligan.note ...more deleted... 1352 => .\PyTools\visitor_fixnames.py 1353 => .\PyTools\visitor_find_quiet2.py 1354 => .\PyTools\visitor_find.pyc 1355 => .\PyTools\visitor_find_quiet1.py 1356 => .\PyTools\fixeoln_one.doc.txt Visited 1356 files and 119 dirs If you instead invoke this script with a "2" as its first argument, it makes and runs a SearchVisitor object, using the second argument as the search key. This form is equivalent to running the search_all.py script we met earlier; it pauses for an Enter key press after each matching file is reported (lines in bold font here): C:\temp\examples>python %X%\PyTools\visitor.py 2 Part3 . ... 1 => .\autoexec.bat 2 => .\cleanall.csh .\cleanall.csh has Part3 3 => .\echoEnvironment.pyw 4 => .\Launcher.py .\Launcher.py has Part3 5 => .\Launcher.pyc Skipping .\Launcher.pyc 6 => .\Launch_PyGadgets.py 7 => .\Launch_PyDemos.pyw 8 => .\LaunchBrowser.out.txt 9 => .\LaunchBrowser.py 10 => .\Launch_PyGadgets_bar.pyw 11 => .\makeall.csh .\makeall.csh has Part3 ... ...more deleted ... 1353 => .\PyTools\visitor_find_quiet2.py 1354 => .\PyTools\visitor_find.pyc Skipping .\PyTools\visitor_find.pyc 1355 => .\PyTools\visitor_find_quiet1.py 1356 => .\PyTools\fixeoln_one.doc.txt Found in 49 files, visited 1356 Technically, passing this script a first argument "3" runs both a FileVisitor and a SearchVisitor (two separate traversals are performed). The first argument is really used as a bitmask to select one or more supported self-tests -- if a test's bit is on in the binary value of the argument, the test will be run. Because 3 is 011 in binary, it selects both a search (010) and a listing (001). In a more user-friendly system we might want to be more symbolic about that (e.g., check for "-search" and "-list" arguments), but bitmasks work just as well for this script's scope.
5.5.1 Editing Files in Directory TreesNow, after genericizing tree traversals and searches, it's an easy step to add automatic file editing in a brand-new, separate component. Example 5-12 defines a new EditVisitor class that simply customizes the visitmatch method of the SearchVisitor class, to open a text editor on the matched file. Yes, this is the complete program -- it needs to do something special only when visiting matched files, and so need provide only that behavior; the rest of the traversal and search logic is unchanged and inherited. Example 5-12. PP2E\PyTools\visitor_edit.py############################################################### # Use: "python PyTools\visitor_edit.py string". # add auto-editor start up to SearchVisitor in an external # component (subclass), not in-place changes; this version # automatically pops up an editor on each file containing the # string as it traverses; you can also use editor='edit' or # 'notepad' on windows; 'vi' and 'edit' run in console window; # editor=r'python Gui\TextEditor\textEditor.pyw' may work too; # caveat: we might be able to make this smarter by sending # a search command to go to the first match in some editors; ############################################################### import os, sys, string from visitor import SearchVisitor listonly = 0 class EditVisitor(SearchVisitor): """ edit files at and below startDir having string """ editor = 'vi' # ymmv def visitmatch(self, fname, text): os.system('%s %s' % (self.editor, fname)) if __name__ == '__main__': visitor = EditVisitor(sys.argv[1], listonly) visitor.run('.') print 'Edited %d files, visited %d' % (visitor.scount, visitor.fcount) When we make and run an EditVisitor, a text editor is started with the os.system command-line spawn call, which usually blocks its caller until the spawned program finishes. On my machines, each time this script finds a matched file during the traversal, it starts up the vi text editor within the console window where the script was started; exiting the editor resumes the tree walk. Let's find and edit some files. When run as a script, we pass this program the search string as a command argument (here, the string "-exec" is the search key, not an option flag). The root directory is always passed to the run method as ".", the current run directory. Traversal status messages show up in the console as before, but each matched file now automatically pops up in a text editor along the way. Here, the editor is started eight times: C:\...\PP2E>python PyTools\visitor_edit.py -exec 1 => .\autoexec.bat 2 => .\cleanall.csh 3 => .\echoEnvironment.pyw 4 => .\Launcher.py 5 => .\Launcher.pyc Skipping .\Launcher.pyc ...more deleted... 1340 => .\old_Part2\Basics\unpack2.py 1341 => .\old_Part2\Basics\unpack2b.py 1342 => .\old_Part2\Basics\unpack3.py 1343 => .\old_Part2\Basics\__init__.py Edited 8 files, visited 1343 This, finally, is the exact tool I was looking for to simplify global book examples tree maintenance. After major changes to things like shared modules and file and directory names, I run this script on the examples root directory with an appropriate search string, and edit any files it pops up as needed. I still need to change files by hand in the editor, but that's often safer than blind global replacements. 5.5.2 Global Replacements in Directory TreesBut since I brought it up: given a general tree traversal class, it's easy to code a global search-and-replace subclass too. The FileVisitor subclass in Example 5-13, ReplaceVisitor, customizes the visitfile method to globally replace any appearances of one string with another, in all text files at and below a root directory. It also collects the names of all files that were changed in a list, just in case you wish to go through and verify the automatic edits applied (a text editor could be automatically popped up on each changed file, for instance). Example 5-13. PP2E\PyTools\visitor_replace.py################################################################ # Use: "python PyTools\visitor_replace.py fromStr toStr". # does global search-and-replace in all files in a directory # tree--replaces fromStr with toStr in all text files; this # is powerful but dangerous!! visitor_edit.py runs an editor # for you to verify and make changes, and so is much safer; # use CollectVisitor to simply collect a list of matched files; ################################################################ import os, sys, string from visitor import SearchVisitor listonly = 0 class ReplaceVisitor(SearchVisitor): """ change fromStr to toStr in files at and below startDir; files changed available in obj.changed list after a run """ def __init__(self, fromStr, toStr, listonly=0): self.changed = [] self.toStr = toStr SearchVisitor.__init__(self, fromStr, listonly) def visitmatch(self, fname, text): fromStr, toStr = self.context, self.toStr text = string.replace(text, fromStr, toStr) open(fname, 'w').write(text) self.changed.append(fname) if __name__ == '__main__': if raw_input('Are you sure?') == 'y': visitor = ReplaceVisitor(sys.argv[1], sys.argv[2], listonly) visitor.run(startDir='.') print 'Visited %d files' % visitor.fcount print 'Changed %d files:' % len(visitor.changed) for fname in visitor.changed: print fname To run this script over a directory tree, go to the directory to be changed and run the following sort of command line, with "from" and "to" strings. On my current machine, doing this on a 1354-file tree and changing 75 files along the way takes roughly six seconds of real clock time when the system isn't particularly busy: C:\temp\examples>python %X%/PyTools/visitor_replace.py Part2 SPAM2 Are you sure?y . ... 1 => .\autoexec.bat 2 => .\cleanall.csh 3 => .\echoEnvironment.pyw 4 => .\Launcher.py 5 => .\Launcher.pyc Skipping .\Launcher.pyc 6 => .\Launch_PyGadgets.py ...more deleted... 1351 => .\PyTools\visitor_find_quiet2.py 1352 => .\PyTools\visitor_find.pyc Skipping .\PyTools\visitor_find.pyc 1353 => .\PyTools\visitor_find_quiet1.py 1354 => .\PyTools\fixeoln_one.doc.txt Visited 1354 files Changed 75 files: .\Launcher.py .\LaunchBrowser.out.txt .\LaunchBrowser.py .\PyDemos.pyw .\PyGadgets.py .\README-PP2E.txt ...more deleted... .\PyTools\search_all.out.txt .\PyTools\visitor.out.txt .\PyTools\visitor_edit.py [to delete, use an empty toStr] C:\temp\examples>python %X%/PyTools/visitor_replace.py SPAM "" This is both wildly powerful and dangerous. If the string to be replaced is something that can show up in places you didn't anticipate, you might just ruin an entire tree of files by running the ReplaceVisitor object defined here. On the other hand, if the string is something very specific, this object can obviate the need to automatically edit suspicious files. For instance, we will use this approach to automatically change web site addresses in HTML files in Chapter 12; the addresses are likely too specific to show up in other places by chance. 5.5.3 Collecting Matched Files in TreesThe scripts so far search and replace in directory trees, using the same traversal code base (module visitor). Suppose, though, that you just want to get a Python list of files in a directory containing a string. You could run a search and parse the output messages for "found" messages. Much simpler, simply knock off another SearchVisitor subclass to collect the list along the way, as in Example 5-14. Example 5-14. PP2E\PyTools\visitor_collect.py################################################################# # Use: "python PyTools\visitor_collect.py searchstring". # CollectVisitor simply collects a list of matched files, for # display or later processing (e.g., replacement, auto-editing); ################################################################# import os, sys, string from visitor import SearchVisitor class CollectVisitor(SearchVisitor): """ collect names of files containing a string; run this and then fetch its obj.matches list """ def __init__(self, searchstr, listonly=0): self.matches = [] SearchVisitor.__init__(self, searchstr, listonly) def visitmatch(self, fname, text): self.matches.append(fname) if __name__ == '__main__': visitor = CollectVisitor(sys.argv[1]) visitor.run(startDir='.') print 'Found these files:' for fname in visitor.matches: print fname CollectVisitor is just tree search again, with a new kind of specialization -- collecting files, instead of printing messages. This class is useful from other scripts that mean to collect a matched files list for later processing; it can be run by itself as a script too: C:\...\PP2E>python PyTools\visitor_collect.py -exec ... ...more deleted... ... 1342 => .\old_Part2\Basics\unpack2b.py 1343 => .\old_Part2\Basics\unpack3.py 1344 => .\old_Part2\Basics\__init__.py Found these files: .\package.csh .\README-PP2E.txt .\readme-old-pp1E.txt .\PyTools\cleanpyc.py .\PyTools\fixeoln_all.py .\System\Processes\output.txt .\Internet\Cgi-Web\fixcgi.py <IP_ADDRESS> Suppressing status messagesHere, the items in the collected list are displayed at the end -- all the files containing the string "-exec". Notice, though, that traversal status messages are still printed along the way (in fact, I deleted about 1600 lines of such messages here!). In a tool meant to be called from another script, that may be an undesirable side effect; the calling script's output may be more important than the traversal's. We could add mode flags to SearchVisitor to turn off status messages, but that makes it more complex. Instead, the following two files show how we might go about collecting matched filenames without letting any traversal messages show up in the console, all without changing the original code base. The first, shown in Example 5-15, simply takes over and copies the search logic, without print statements. It's a bit redundant with SearchVisitor, but only in a few lines of mimicked code. Example 5-15. PP2E\PyTools\visitor_collect_quiet1.py############################################################## # Like visitor_collect, but avoid traversal status messages ############################################################## import os, sys, string from visitor import FileVisitor, SearchVisitor class CollectVisitor(FileVisitor): """ collect names of files containing a string, silently; """ skipexts = SearchVisitor.skipexts def __init__(self, searchStr): self.matches = [] self.context = searchStr def visitdir(self, dname): pass def visitfile(self, fname): if (os.path.splitext(fname)[1] not in self.skipexts and string.find(open(fname).read( ), self.context) != -1): self.matches.append(fname) if __name__ == '__main__': visitor = CollectVisitor(sys.argv[1]) visitor.run(startDir='.') print 'Found these files:' for fname in visitor.matches: print fname When this class is run, only the contents of the matched filenames list show up at the end; no status messages appear during the traversal. Because of that, this form may be more useful as a general-purpose tool used by other scripts: C:\...\PP2E>python PyTools\visitor_collect_quiet1.py -exec Found these files: .\package.csh .\README-PP2E.txt .\readme-old-pp1E.txt .\PyTools\cleanpyc.py .\PyTools\fixeoln_all.py .\System\Processes\output.txt .\Internet\Cgi-Web\fixcgi.py A more interesting and less redundant way to suppress printed text during a traversal is to apply the stream redirection tricks we met in Chapter 2. Example 5-16 sets sys.stdin to a NullOut object that throws away all printed text for the duration of the traversal (its write method does nothing). The only real complication with this scheme is that there is no good place to insert a restoration of sys.stdout at the end of the traversal; instead, we code the restore in the __del__ destructor method, and require clients to delete the visitor to resume printing as usual. An explicitly called method would work just as well, if you prefer less magical interfaces. Example 5-16. PP2E\PyTools\visitor_collect_quiet2.py############################################################## # Like visitor_collect, but avoid traversal status messages ############################################################## import os, sys, string from visitor import SearchVisitor class NullOut: def write(self, line): pass class CollectVisitor(SearchVisitor): """ collect names of files containing a string, silently """ def __init__(self, searchstr, listonly=0): self.matches = [] self.saveout, sys.stdout = sys.stdout, NullOut( ) SearchVisitor.__init__(self, searchstr, listonly) def __del__(self): sys.stdout = self.saveout def visitmatch(self, fname, text): self.matches.append(fname) if __name__ == '__main__': visitor = CollectVisitor(sys.argv[1]) visitor.run(startDir='.') matches = visitor.matches del visitor print 'Found these files:' for fname in matches: print fname When this script is run, output is identical to the prior run -- just the matched filenames at the end. Perhaps better still, why not code and debug just one verbose CollectVisitor utility class, and require clients to wrap calls to its run method in the redirect.redirect function we wrote back in Example 2-10 ? >>> from PP2E.PyTools.visitor_collect import CollectVisitor >>> from PP2E.System.Streams.redirect import redirect >>> walker = CollectVisitor('-exec') # object to find '-exec' >>> output = redirect(walker.run, ('.',), '') # function, args, input >>> for line in walker.matches: print line # print items in list ... .\package.csh .\README-PP2E.txt .\readme-old-pp1E.txt .\PyTools\cleanpyc.py .\PyTools\fixeoln_all.py .\System\Processes\output.txt .\Internet\Cgi-Web\fixcgi.py The redirect call employed here resets standard input and output streams to file-like objects for the duration of any function call; because of that, it's a more general way to suppress output than recoding every outputter. Here, it has the effect of intercepting (and hence suppressing) printed messages during a walker.run('.') traversal. They really are printed, but show up in the string result of the redirect call, not on the screen: >>> output[:60] '. ...\0121 => .\\autoexec.bat\0122 => .\\cleanall.csh\0123 => .\\echoEnv' >>> import string >>> len(output), len(string.split(output, '\n')) # bytes, lines (67609, 1592) >>> walker.matches ['.\\package.csh', '.\\README-PP2E.txt', '.\\readme-old-pp1E.txt', '.\\PyTools\\cleanpyc.py', '.\\PyTools\\fixeoln_all.py', '.\\System\\Processes\\output.txt', '.\\Internet\\Cgi-Web\\fixcgi.py'] Because redirect saves printed text in a string, it may be less appropriate than the two quiet CollectVisitor variants for functions that generate much output. Here, for example, 67,609 bytes of output was queued up in an in-memory string (see the len call results); such a buffer may or may not be significant in some applications. In more general terms, redirecting sys.stdout to dummy objects as done here is a simple way to turn off outputs (and is the equivalent to the Unix notion of redirecting output to file /dev/null -- a file that discards everything sent to it). For instance, we'll pull this trick out of the bag again in the context of server-side Internet scripting, to prevent utility status messages from showing up in generated web page output streams.[10]
5.5.4 Recoding Fixers with VisitorsBe warned: once you've written and debugged a class that knows how to do something useful like walking directory trees, it's easy for it to spread throughout your system utility libraries. Of course, that's the whole point of code reuse. For instance, very soon after writing the visitor classes presented in the prior sections, I recoded both the fixnames_all.py and fixeoln_all.py directory walker scripts listed earlier in Examples Example 5-6 and Example 5-4, respectively, to use visitor instead of proprietary tree-walk logic (they both originally used find.find). Example 5-17 combines the original convertLines function (to fix end-of-lines in a single file) with visitor's tree walker class, to yield an alternative implementation of the line-end converter for directory trees. Example 5-17. PP2E\PyTools\visitor_fixeoln.py############################################################## # Use: "python visitor_fixeoln.py todos|tounix". # recode fixeoln_all.py as a visitor subclass: this version # uses os.path.walk, not find.find to collext all names first; # limited but fast: if os.path.splitext(fname)[1] in patts: ############################################################## import visitor, sys, fnmatch, os from fixeoln_dir import patts from fixeoln_one import convertEndlines class EolnFixer(visitor.FileVisitor): def visitfile(self, fullname): # match on basename basename = os.path.basename(fullname) # to make result same for patt in patts: # else visits fewer if fnmatch.fnmatch(basename, patt): convertEndlines(self.context, fullname) self.fcount = self.fcount + 1 # could break here # but results differ if __name__ == '__main__': walker = EolnFixer(sys.argv[1]) walker.run( ) print 'Files matched (converted or not):', walker.fcount As we saw in Chapter 2, the built-in fnmatch module performs Unix shell-like filename matching; this script uses it to match names to the previous version's filename patterns (simply looking for filename extensions after a "." is simpler, but not as general): C:\temp\examples>python %X%/PyTools/visitor_fixeoln.py tounix . ... Changing .\echoEnvironment.pyw Changing .\Launcher.py Changing .\Launch_PyGadgets.py Changing .\Launch_PyDemos.pyw ...more deleted... Changing .\PyTools\visitor_find.py Changing .\PyTools\visitor_fixnames.py Changing .\PyTools\visitor_find_quiet2.py Changing .\PyTools\visitor_find_quiet1.py Changing .\PyTools\fixeoln_one.doc.txt Files matched (converted or not): 1065 C:\temp\examples>python %X%/PyTools/visitor_fixeoln.py tounix ...more deleted... .\Extend\Swig\Shadow ... .\ ... .\EmbExt\Exports ... .\EmbExt\Exports\ClassAndMod ... .\EmbExt\Regist ... .\PyTools ... Files matched (converted or not): 1065 If you run this script and the original fixeoln_all.py on the book examples tree, you'll notice that this version visits two fewer matched files. This simply reflects the fact that fixeoln_all also collects and skips over two directory names for its patterns in the find.find result (both called "Output"). In all other ways, this version works the same way even when it could do better -- adding a break statement after the convertEndlines call here avoids visiting files that appear redundantly in the original's find results lists. The first command here takes roughly six seconds on my computer, and the second takes about four (there are no files to be converted). That's faster than the eight- and six-second figures for the original find.find-based version of this script, but they differ in amount of output, and benchmarks are usually much more subtle than you imagine. Most of the real clock time is likely spent scrolling text in the console, not doing any real directory processing. Since both are plenty fast for their intended purposes, finer-grained performance figures are left as exercises. The script in Example 5-18 combines the original convertOne function (to rename a single file or directory) with the visitor's tree walker class, to create a directory tree-wide fix for uppercase filenames. Notice that we redefine both file and directory visitation methods here, as we need to rename both. Example 5-18. PP2E\PyTools\visitor_fixnames.py############################################################### # recode fixnames_all.py name case fixer with the Visitor class # note: "from fixnames_all import convertOne" doesn't help at # top-level of the fixnames class, since it is assumed to be a # method and called with extra self argument (an exception); ############################################################### from visitor import FileVisitor class FixnamesVisitor(FileVisitor): """ check filenames at and below startDir for uppercase """ import fixnames_all def __init__(self, listonly=0): FileVisitor.__init__(self, listonly=listonly) self.ccount = 0 def rename(self, pathname): if not self.listonly: convertflag = self.fixnames_all.convertOne(pathname) self.ccount = self.ccount + convertflag def visitdir(self, dirname): FileVisitor.visitdir(self, dirname) self.rename(dirname) def visitfile(self, filename): FileVisitor.visitfile(self, filename) self.rename(filename) if __name__ == '__main__': walker = FixnamesVisitor( ) walker.run( ) allnames = walker.fcount + walker.dcount print 'Converted %d files, visited %d' % (walker.ccount, allnames) This version is run like the original find.find based version, fixnames_all, but visits one more name (the top-level root directory), and there is no initial delay while filenames are collected on a list -- we're using os.path.walk again, not find.find. It's also close to the original os.path.walk version of this script, but is based on a class hierarchy, not direct function callbacks: C:\temp\examples>python %X%/PyTools/visitor_fixnames.py ...more deleted... 303 => .\__init__.py 304 => .\__init__.pyc 305 => .\Ai\ExpertSystem\holmes.tar 306 => .\Ai\ExpertSystem\TODO Convert dir=.\Ai\ExpertSystem file=TODO? (y|Y) 307 => .\Ai\ExpertSystem\__init__.py 308 => .\Ai\ExpertSystem\holmes\cnv 309 => .\Ai\ExpertSystem\holmes\README.1ST Convert dir=.\Ai\ExpertSystem\holmes file=README.1ST? (y|Y) ...more deleted... 1353 => .\PyTools\visitor_find.pyc 1354 => .\PyTools\visitor_find_quiet1.py 1355 => .\PyTools\fixeoln_one.doc.txt Converted 1 files, visited 1474 Both of these fixer scripts work roughly the same as the originals, but because the directory walking logic lives in just one file (visitor.py), it only needs to be debugged once. Moreover, improvements in that file will automatically be inherited by every directory-processing tool derived from its classes. Even when coding system-level scripts, reuse and reduced redundancy pay off in the end. 5.5.5 Fixing File Permissions in TreesJust in case the preceding visitor-client sections weren't quite enough to convince you of the power of code reuse, another piece of evidence surfaced very late in this book project. It turns out that copying files off a CD using Windows drag-and-drop makes them read-only in the copy. That's less than ideal for the book examples directory on the enclosed CD (see http://examples.oreilly.com/python2) -- you must copy the directory tree onto your hard drive to be able to experiment with program changes (naturally, files on CD can't be changed in place). But if you copy with drag-and-drop, you may wind up with a tree of over 1000 read-only files. Since drag-and-drop is perhaps the most common way to copy off a CD on Windows, I needed a portable and easy-to-use way to undo the read-only setting. Asking readers to make these all writable by hand would be impolite to say the least. Writing a full-blown install system seemed like overkill. Providing different fixes for different platforms doubles or triples the complexity of the task. Much better, the Python script in Example 5-19 can be run in the root of the copied examples directory to repair the damage of a read-only drag-and-drop operation. It specializes the traversal implemented by the FileVisitor class again -- this time to run an os.chmod call on every file and directory visited along the way. Example 5-19. PP2E\PyTools\fixreadonly-all.py#!/usr/bin/env python ############################################################### # Use: python PyTools\fixreadonly-all.py # run this script in the top-level examples directory after # copying all examples off the book's CD-ROM, to make all # files writeable again--by default, copying files off the # CD with Windows drag-and-drop (at least) creates them as # read-only on your hard drive; this script traverses entire # dir tree at and below the dir it is run in (all subdirs); ############################################################### import os, string from PP2E.PyTools.visitor import FileVisitor # os.path.walk wrapper listonly = 0 class FixReadOnly(FileVisitor): def __init__(self, listonly=0): FileVisitor.__init__(self, listonly=listonly) def visitDir(self, dname): FileVisitor.visitfile(self, fname) if self.listonly: return os.chmod(dname, 0777) def visitfile(self, fname): FileVisitor.visitfile(self, fname) if self.listonly: return os.chmod(fname, 0777) if __name__ == '__main__': # don't run auto if clicked go = raw_input('This script makes all files writeable; continue?') if go != 'y': raw_input('Canceled - hit enter key') else: walker = FixReadOnly(listonly) walker.run( ) print 'Visited %d files and %d dirs' % (walker.fcount, walker.dcount) As we saw in Chapter 2, the built-in os.chmod call changes the permission settings on an external file (here, to 0777 -- global read, write, and execute permissions). Because os.chmod and the FileVisitor's operations are portable, this same script will work to set permissions in an entire tree on both Windows and Unix-like platforms. Notice that it asks whether you really want to proceed when it first starts up, just in case someone accidentally clicks the file's name in an explorer GUI. Also note that Python must be installed before this script can be run to make files writable; that seems a fair assumption to make of users about to change Python scripts. C:\temp\examples>python PyTools\fixreadonly-all.py This script makes all files writeable; continue?y . ... 1 => .\autoexec.bat 2 => .\cleanall.csh 3 => .\echoEnvironment.pyw ...more deleted... 1352 => .\PyTools\visitor_find.pyc 1353 => .\PyTools\visitor_find_quiet1.py 1354 => .\PyTools\fixeoln_one.doc.txt Visited 1354 files and 119 dirs |
| I l@ve RuBoard |


Download Virtual Device With Google Apps In Genymotion Stack Overflow
Virtual Machine For Android Apk Download
Android Studio Doesn T Show X86 64 As Option For Any Virtual Device Stack Overflow
Run Apps On The Android Emulator Android Developers
Install Android 8 1 Oreo In Virtual Machine Vmware And Virtualbox
How To Create Android Virtual Device Avd In Android Studio
Avd Android Virtual Device Hacktricks
15 Best Android Emulators For Pc And Mac Of 2021 Android Authority
Andro Virtual Device Mini Android Emulator For Windows Xp Hd Png Download Vhv
How To Install Google Play App In Android Studio Emulator Stack Overflow
Limbo Emulator 5 0 0 Download For Android Apk Free
Android Emulator Q Preview A New Preview Of Android Q Has Been By Carlos Mota Code Procedure And Rants Medium
Creating Android Virtual Device Avd Sectiontitle This Section Provides A Tutorial Example On How To Create An Android Virtual Device Avd Which Is An Emulator Configuration That Lets You To Model An Actual Android Device Android Sdk Platform
Download Android Virtual Device For Android Studio Everkm
Android アプリ用のエミュレーター Visual Studio
React Native Android Development For Mac By Matt Mcnamee Pvtl Medium
How To Run Android Apps On Your Windows Pc Extremetech
Building An Android App With Aws Amplify Part 1 Front End Web Mobile
Tutorial Create Your First Android Application Intellij Idea
How To Install Android Ide And Sdk And Get Started With Android Programming
How To Install Android Market Android Market For Emulator Download Android Market Apk File I Am A Programmer
How To Reduce Android App Development Time Using Genymotion Free Emulator For Personal Use With Android Studio Androidride


Happening Cities
Cities you must explore this summer
Istanbul
7 listings
Hon Kong
New York
Sydney
Amsterdam
London
Most Visited Places
Explore the greates places in the city. You won’t be disappointed.
Preview
Save
Hills Restaurant
3 Ratings
Restaurant
Open
Roma, Italy
+ 44 20 456 823
Preview
Save
Urban Hotels
3 Ratings
Restaurant
Open
London, England
+ 44 20 456 823
Preview
Save
Liberty Club
3 Ratings
Restaurant
Open
Istanbul, Turkey
+ 44 20 456 823
See How It Works
Discover & connect with great local businesses
Choose What To Do
Aliquam lorem ante, dapibus in, viverra quis, feugiat
Phasellus viverra nulla ut
metus varius laoreet.
Find What You Want
Aliquam lorem ante, dapibus in, viverra quis, feugiat
Phasellus viverra nulla ut
metus varius laoreet.
Amazing Places
Aliquam lorem ante, dapibus in, viverra quis, feugiat
Phasellus viverra nulla ut
metus varius laoreet.
News & Tips
Checkout latest news and articles from our blog
January 18, 2018
Making Coffee, since 1845. Coffee For All
February 25, 2018
The Best Music For Your Entertainment
April 04, 2018


Welcome Google and Congratulations Samsung!
Today, at Microsoft’s Connect() event in New York we announced some important news regarding the .NET Foundation Technical Steering Group.
First of all, I’m thrilled to welcome Google to the .NET Foundation Technical Steering Group joining Microsoft, Red Hat, JetBrains, Unity and Samsung to help bring greater innovation to the .NET platform.
Google has been one of the most active contributors outside of Microsoft to .NET Foundation projects over the past two years as well as helping to drive the ECMA Standardization process for C#. .NET workloads have first-class support on Google Cloud Platform including recently announced native integrations into the popular Visual Studio IDE on Windows and deep support for PowerShell. Google’s work is a natural fit into the Technical Steering Group and I’m glad they have agreed to come on board to help steer the future direction of the platform.
“We’re very happy to add .NET support to our list of supported frameworks on Google Cloud Platform,” said Chris Sells, Lead PM for Google Cloud Developer Tools. “Enterprises moving their existing Windows and .NET workloads to the cloud or those targeting .NET Core can find what they need to build great apps for Google Cloud Platform.”
Secondly, back in June 2016 I had the pleasure of announcing that Samsung had joined the technical steering group. They have been focusing on ARM support in .NET Core and today we got to see the first fruits of their labor with the preview release of .NET Core support for the Tizen operating system and their Visual Studio Tools for Tizen.
Tizen is an open source operating system based on Linux, supported by the Linux Foundation and open to all developers. Tizen powers 50 million Samsung devices, including Smart TVs, wearables, smartphones, and home appliances. Today, Samsung is releasing the first preview of Visual Studio Tools for Tizen, which supports mobile application development with device emulators and an extension to Visual Studio with full IntelliSense and debugging capabilities. The support for Smart TVs, wearables, and other IoT devices will be added in future releases. Tizen’s .NET support will be officially released and shipping on Samsung devices, including Smart TVs, in 2017. This will allow .NET developers to build applications to deploy on Tizen across the globe and continues in our mission to bring the productive .NET development platform to everyone.
“Samsung is excited to be a part of the .NET community. .NET has a huge developer base and future potential,” said Samsung’s Executive Vice President and Deputy Head of Software R&D Center Seung-hwan Cho. “Through thoughtful and progressive collaboration, Samsung is expecting to create unique development experiences for both Tizen and C# developers, enriching the Tizen ecosystem.”
Their work builds on top of several .NET Foundation projects including .NET Core, Mono and Xamarin Forms.
- Tizen’s .NET support is a part of the .NET Core open source project: https://github.com/dotnet/core
- Tizen’s Xamarin.Forms support is a part of the Xamarin.Forms open source project: https://github.com/xamarin/Xamarin.Forms
- Tizen’s device APIs are a part of the Tizen open source project: https://source.tizen.org
- Download Visual Studio Tools for Tizen here: http://www.aka.ms/tizen
Other .NET Foundation projects have also been very busy. Today, .NET Core, EF Core 1.1 and ASP.NET Core 1.1 were also released including several new features and APIs along with support for more operating system distributions (now up to 12). For more information see the .NET Team Blog.
It’s also very exciting to see that ASP.NET Core MVC is now a top-performing web framework on TechEmpower. Today TechEmpower released their Round 13 results which show ASP.NET Core MVC as the fastest mainstream fullstack web framework in the Plantext test.
The Technical Steering Group was formed in late March 2016 and we are already seeing huge progress. Red Hat have released the first release of .NET Core for RHEL, JetBrains have been producing build after build of Project Rider as .NET Core’s tooling approaches it’s V1.0, Unity have announced support for C#6 and now the Tizen news from Samsung along with Google coming on board and supporting ASP.NET as a first class citizen in Google Cloud Platform. It’s fantastic to witness the innovation that is happening on top of the .NET platform right now, all of it only possible because of .NET being open source and welcoming to all.
It’s certainly an incredibly exciting time to be a .NET developer!
-- Martin


Social media has never been private. From the initial release of Facebook to the last update of
Twitter. That is until now, we have created a truly privacy first social network called Siddes.
It started in late 2019 with an idea. We did not act on it at first because we didn't know
how well it would do. But, in mid to late 2020, when all were home and cyber-threats were up 93%, we
decided to act on the idea.
We are glad we did, because after a couple months of development,
we are happy to release Siddes 1.0 to the public on January 1st 2021! We hope we can help the web as
much as it has helped us, by providing a way to use the web while not having to worry about your
privacy.
Siddes.com


1) I can get stuck too deep into a rabbit hole of cool code (e.g building the website) if I am not careful. 2) I like to take timely breaks every 30-45 minutes even if it is just to stretch 3) Pretty bad when it comes to making regular commits
Values, empathy and self awareness play major roles when it comes to learning with others and programming together. Having your core values close to our heart allows us to stay true to ourselves especially in stressful situations. Whether it’s making sure we are still being kind to those next to us or staying fit and healthy while we are working through code, core values are definitely important. Empathy boosts our ability to learn as a community. If we see someone struggling with a problem that we have gone through as well then being empathic is like saying, “Hey, I’ve been done that road before. Let me give you a hand”. Self-awareness is being able to notice what we are feeling as we are feeling it. If a problem comes up and we are super frustrated, then being self-aware lets us take a step back and say, “Hold on, I’m really annoyed at this problem and maybe I should take a breather and clear my mind”.
It’s been surprising how effective it has been on my overall approach to learning. In general, I think most of us aren’t personal diary writers so being given the chance to write and reflect on ourselves in this way is a pretty invigorating feeling.
Just being comfortable with what I’m writing down. It’s easy to write down what we are thinking and feeling, but then it’s a whole next step up to be able to show someone else what we wrote.
As you guys have mentioned, employability is one of the major reasons, but I think it is also about relieving a bit of tension. For me, coding is like a huge mountain to climb. There are so many different routes and things to learn and it can be pretty overwhelming especially when you think about all the other people out there that have mastered the language and know everything from head to toe. It’s easy for me to overthink and stress out about learning all this code so having core learning come in and give us the chance to think about how we are feeling just makes the journey less robotic and less daunting, if that makes sense.
For me it’s nice to have the space and time to build on myself as I am learning. It really is surprising what you end up learning about yourself when you’re prompted to.
I would like to start my programming career with a job in web development. The opportunity to work remotely is very attractive with my current lifestyle and would give me some extra time to work on my current relationships with friends/family etc. Long time, I would like to find my way into A.I development if the life leads me that way.
Looking back at my Sprint 2 reflection, I think my strengths are still similar. My ability to quickly cooperate and get stuck into work will come in handy when it comes to the pair programming side of things. I like to get stuck into my work and try not to waste too much time unless I need a break. I pointed out before that one of my limitations was not being confident in my code and thinking it is not good enough for others to see. However, over the remaining course of Foundation, this has improved a lot and I've started to feel more comfortable and capable in coding through problems. One thing I am scared of is just slowing everyone else down.
For me, a non-technical challenge is getting used to the pace of Bootcamp and the workload as well. We're being prepared for 9+ hours of coding a day for 9 weeks and it does sound pretty daunting. I hope I can make it through!
More self-confidence in social situations, especially in groups. Just being able to openly speak about my ideas and opinions without the feel of being judged in a bad way. I also often find myself trying to overcompensate by making bad jokes so I apologise in advanced.
My expectations for myself is to stay true to myself throughout these 9 weeks and to push my limitations. I want to be able to walk out of EDA with the feeling that I just achieved something awesome and huge. I’m coming into EDA as a beginner in a web programming and I know that others in the cohort have more experience and knowledge than I do. Naturally, I like to have my own time to work through a problem and see if I can do it by myself. It's when I get to the point of pure frustation is when I feel the need to ask others for help, especially if the answer isn't on Google or isn't explained well there.


DHS Study on Mobile Device Security
This is a review of the DHS Study on Mobile Device Security
Mobile Security Threats and Defenses
Mobile Security Threats Categories
| Threat | Definition | Examples |
|---|---|---|
Denial of Service |
Deny or degrade service to users |
"Jamming of wireless communications, "Jamming of wireless communications |
overloading networks with bogus traffic |
ransomware |
theft of mobile device or mobile services." |
Geolocation |
Physical tracking of user. |
"Passively or actively obtaining accurate three-dimensional coordinates of target, "Passively or actively obtaining accurate three-dimensional coordinates of target |
possibly including speed and direction." |
Information Disclosure |
Unauthorized access to information or services. |
"Interception of data in transit, "Interception of data in transit |
leakage or exfiltration of user |
app |
or enterprise data |
tracking of user location |
eavesdropping on voice or data communications |
surreptitiously activating the phone’s microphone or camera to spy on the user." |
Spoofing |
Impersonating something or someone |
Email or SMS message pretending to be from boss or colleague (social engineering); fraudulent Wi-Fi access point or cellular base station mimicking a legitimate one. |
Tampering |
"Modifying data, "Modifying data |
software |
firmware |
or hardware without authorization. " |
"Modifying data in transit, "Modifying data in transit |
inserting tampered hardware or software into supply chain |
repackaging legitimate app with malware |
Threats in the Mobile Device Technology Stack
Mobile Operating System
-
Threats
-
Mobile OS vulnerabilities
-
Vendors and Carriers slow to rollout system updates (especially for Android)
-
Jailbroke or rooted devices
-
Vulnerabilities in vendor or carrier-specific additions
-
Vulnerabilities in cloud services provided by the vendors
-
Install application using PC
-
-
Defenses
-
Ensure devices are patched against publicly known security vulnerabilities and are running the most recent OS
-
Consider blocking access if devices are out of date
-
Enterprises should seek commitment from device vendors that security updates will be provided
-
Advice user not to root or jailbreak devices.
-
Enable strong authentication for cloud services
-
Low-Level Device Components
-
Threats
-
Bootloader vulnerabilities
-
Vulnerabilities in the isolated execution environments. e.g Trusted Execution Environment on Android and Apple’s Secure Enclave
-
Vulnerabilities in baseband processors
-
Softwares that below the OS added by Mobile Network Operators
-
-
Defenses
-
Ensure devices are patched against publicly known security vulnerabilities
-
Enable device integrity checking capabilities
-
Defense Gaps
-
The inability of enterprises to gain visibility into indicators of adversary activity such as indications of exploitation of previously unknown (zero-day) vulnerabilities.
-
Variations in security update speed and availability depending on the device vendor or network carrier.
-
The inattention to software assurance best practices during the development of some mobile device components.
-
The failure to use strong authentication mechanisms—even when available—for cloud services on which the device depends for secure functionality.
-
Much effort has gone into increasing the resilience of mobile device components against exploitation, but continued effort is required in this area and should focus not only on the mobile operating system but also on lower-level components such as TEEs and baseband processors and the software/firmware used to operate them.
-
Software or firmware installed by the MNO or OEM is typically outside the purview of the mobile operating system provider, making it difficult to detect.
Threats in Mobile Applications
Threats against Vulnerable Applications
-
Threats
-
Insecure Network Communication
-
Files Stored with Insecure File Permissions or in an Unprotected Location
-
Sensitive Information Written to System Log
-
Web Browser Vulnerabilities
-
Vulnerabilities in Third-Party Libraries
-
Cryptographic Vulnerabilities
-
-
Defenses
-
Best practices in development
-
Follow security best practices such as those published by Google for Android and Apple for iOS.
-
Use of free capabilities bundled into the application development environment to assess the security of their applications,
-
Make use of the Network Security Configuration feature recently introduced into Android and the Application Transport Security feature recently introduced into iOS
-
Consider using commercial mobile application vetting tools that can assess applications for many common vulnerabilities
-
Ensure appropriate data encryption, strong access control, separation between applications (e.g., restricting copy-paste ability), and provide the ability to perform local or remote data wipes of individual application data
-
Deploy and maintain EMM/MDM tools
-
Threat intelligence should be used to understand the potential risks associated with apps installed on devices
-
Ensure devices are running the latest version of iOS or Android because each OS version has brought security architecture improvements and ensure applications receive security patches
-
-
Test cases prior to distribution
-
Static Analysis
-
Static Source Code Analysis
-
Static Byte Code Analysis
-
Static Binary Code Analysis
-
Dynamic Binary Analysis.
-
-
Maintenance following implementation
-
Using threat intelligence as well as monitoring and mitigation when vulnerabilities are discovered
-
-
Threats from Potentially Harmful Applications
-
Threats
-
Gather Privacy-Sensitive Information
-
Surreptitious Eavesdropping
-
Exploiting Vulnerabilities
-
Exploiting Access to Sensitive Enterprise Networks or Data
-
Ransomware
-
Enabling Other Types of Fraud or Malicious Practices
-
Exploiting Public Mobile Application Stores
-
Attempting to Root/Jailbreak a Mobile Device
-
Manipulation of Trusted Apps.
-
Sharing of Data Between Trusted Apps.
-
-
Defenses
-
Best Practices
-
App Vetting
-
Isolation Technologies
-
Out-of-Band Authentication
-
Continuous Authentication
-
Mobile Device Management/Enterprise Mobility Management
-
On-Device, Third-Party Security Applications.
-
Network Monitoring.
-
App Store Mitigations.
-
Defense Gaps
-
Fragmented toolsets
-
Poorly defined set of best practices and security Systems Development Life Cycle for developers—especially for Government use.
-
Lack of focus on mobile application vulnerabilities within the CVE process
-
Lack of robust information sharing of threat intelligence and integration with security tools and techniques
-
Timely notification to organizations and developers of apps affected by a vulnerability
-
Limited visibility and adoption of application-vetting criteria
-
Lack of formalized standards relating security controls to data security categorization
-
Limited knowledge of the comparison between various app vetting tools
-
Lack of enterprise view into the user community and mobile landscape baseline
Threats in Mobile Networks
Key Components in Mobile Networks
-
the Radio Access Network (RAN)
-
Part of the mobile network that connects mobile subscribers to their service provider network using Radio Frequency (RF) signaling over an “air interface,” i.e., wirelessly.
-
Includes tower antennas, RF transceivers and RF controllers.
-
Part of the service is typically encrypted, although the level of encryption varies from network type to network type and by decisions the carrier makes in implementing this capability.
-
-
the Core Network (CN)
-
Is always out of band; the cellular mobile device has no access to it and it runs on different channels.
-
The data between the RAN and the operator’s core network is handled by the backhaul network
-
Holds network logic and is responsible for creating and maintaining the connection between cellular mobile devices and external service networks (e.g., Internet, wireline phones, other carriers and private enterprises) as well as physically tracking all user equipment at all times to enable routing of calls and data streams as users and their devices move throughout the landscape.
-
-
External Services
-
Contain additional end-user services
-
May or may not be provided by the mobile network operator
-
SIM Card
Communicates directly with the carrier’s core network to authenticate itself, the user, and the user’s services and service level.
-
Threats
-
Obtaining Cryptographic Keys
-
SIM Theft
-
SIM Cloning
-
-
Defenses
-
anti-fraud systems deployed by the carrier
-
Radio Access Networks
-
Threats
-
Denial of Service/Jamming
-
Physical Attacks on Base Station Infrastructure.
-
Long Term Evolution (LTE)
-
Downgrade Attacks
-
Eavesdropping.
-
Device and Identity Tracking
-
Preventing Emergency Phone Calls
-
Network Level Denial of Service (DoS) Attacks
-
-
Core Networks
-
Threats
-
Signaling System 7 (SS7)
-
Is the historic control plane for mobile networks
-
Significant weaknesses in SS7 have been known for more than a decade: The problem with the current SS7 system is that messages can be altered, injected or deleted into the global SS7 networks in an uncontrolled manner
-
It has been supplanted by the Diameter Protocol. Most networks use both protocols and it is common for SS7 messages to be “translated” into their Diameter equivalent
-
-
Defenses
-
Are complex and must be implemented at many layers
-
Threats of illegal eavesdropping, data manipulation, and data theft can be mitigated to a degree with secure storage on endpoints and use of encryption for communications in transit
-
Mobile application developers should be encouraged to use the network security features provided by the Android and iOS operating systems to protect the network traffic of their applications against interception or manipulation
-
VPNs can be used to route all network traffic through an encrypted tunnel between the cellular mobile device and an enterprise-controlled network
Gaps
-
Each network component of carrier infrastructure needs specific protection mechanisms
-
Limited or no ability to protect against geolocation of mobile devices and their users
-
The only reliable mitigation against DoS attacks on cellular towers, regions or service providers is alternate communication methods for emergencies
-
Inability to determine whether U.S. carriers have implemented GSMA Interconnect Security Monitoring Guidelines for protection against SS7 attacks.
-
SS7 attack types can be used to target key U.S. Federal Government personnel both in the United States and traveling or working overseas.
Device Physical Access
Threats
-
Stolen or lost devices
-
PC or charging station could potentially abuse USB to attempt to exploit vulnerabilities on the mobile device or to steal sensitive data
-
The USB communication channel could potentially be abused in the reverse direction, enabling a compromised mobile device to launch attacks against the host device to which it is connected
Defenses
-
Ensure that mobile devices always have a screen lock PIN or password.
-
Enterprise capabilities should be put in place to remotely track and—when necessary—remotely wipe mobile devices.
-
Users should be advised not to plug mobile devices directly into public USB charging ports unless a charge-only adapter or cable is used.
Mobile Enterprise
The mobile enterprise consists of systems, applications, processes, and people that work together to control, manage, and integrate the use of mobile devices and related technologies into business and mission operations.
Enterprise Mobility Management
-
Threats
-
Unauthorized access to EMM administrative console
-
Impersonation of EMM server
-
Bypass or subvert EMM agent on mobile device
-
-
Defenses
-
Enterprise security audit
-
Mobile device security audit
-
Threat intelligence
-
Granular authorization
-
Identification and Authentication
-
Secure network connections
-
Trusted Execution Environment
-
Enterprise Mobile Application Stores
-
Threats
-
Impersonation or unauthorized use of administrator credentials, app developer credentials, or distribution certificates.
-
Bypass or subvert application security analysis or vetting techniques.
-
-
Defenses
-
Enterprise security audit
-
Mobile device security audit
-
Threat intelligence
-
Granular authorization
-
Identification and Authentication
-
Gaps
-
Limited ability of enterprise mobility products to detect sophisticated attacks against mobile devices
-
Limited ability of EMM solutions to identify vulnerable mobile devices.
-
Most EMMs lack the ability to directly update the mobile OS
-
More work is needed to encourage enterprise adoption of capabilities to ensure enterprise-owned mobile devices are kept under enterprise management control
-
Lack of guidance on how to integrate EMM solutions with other enterprise security systems to enable effective response and recovery capabilities to compromised or out-ofcompliance mobile devices
-
Improvements in integration of EMM solutions with mobile threat intelligence services
-
Immature vulnerability management processes for mobile OS and mobile apps
-
Stronger mechanisms for data security and data authorization decisions need to be developed
-
The lack of standards for interfacing with TEE has limited use of the technology
Emerging Threats
-
Open Source Signals Intelligence
-
Unfortunately, much of the software and protocols used in RF devices are insecure
-
Now an increasing number of people who have the skills, time, tools and techniques to attack mobile devices and the underlying networks on which they depend
-
-
Decryption of 3G/UMTS Cellular Network Traffic
-
Although 3GPP and GSMA have deprecated some security authentication and encryption standards in the past,advances in deploying replacement systems may not be keeping pace with attacks on the systems currently in use and currently no deprecation schedule is in place if the UMTS (3G) UEA1/UIA1 security algorithms fall.
-
The rise of crypto currencies has fueled a market in high-speed encryption systems. These are now widely available and pose a considerable risk to mobile device privacy and security
-
-
“IMSI Catchers” and Passive Cellular Interceptors.
-
They allow hackers, criminals, and spies to track cell phone users and monitor or record conversations and text messages.
-
Passive cellular interceptors are difficult to detect since they only listen
-
-
Cybercrime and Fraud
-
Because the global mobile ecosystem is so large and so much money exchanges hands, criminals will continue to target it
-
-
Jamming
-
Cell phone jammers are widely available for purchase on the Internet including plans and kits and are even listed by range to show how jammers can deny service across large service areas
-
Can be used to cause cell phones to move off 3G and 4G networks and on to 2G networks where interception and decryption is much easier
-


| 8 | (A) | ȝitt thurgħe pilate ..... .. ... ... ... .. .. .... |
| 8 | (C) | Thorow pylat pyned was . & put on þe rode |
| 8 | (D) | þan Pylate hym pynid | and put on þe rood |
| 8 | (E) | Thorw pylat peyned has was . & put on the roode . |
| (Ex) | ---- no text ---- | |
| 8 | (L) | þrow pylat pyned he was & put on þe rode |
| 8 | (P) | Thurgh Pilat pyned he was & putt on þe rode |
| 8 | (U) | Thurgħ pilat pyned he was / and put on the rode |
| (V) | ---- no text ---- |


{% load static %}
{% include 'user_home/navbar_after_login.html'%}The Adani group saw plunge in wealth amidst ongoing crisis pointing towards its expansion and overtaking of shipping ports
A stock from Ace indian investor Rakesh Jhunjhunwala potfolio which can give massive returns
Every expert was once a beginner. Want to start investing? Start with these fundamentals and follow them to START your investing journey
Avid techie, Cricket Enthusiast and financial follower
Avid techie, Cricket Enthusiast and financial follower
Avid techie, Cricket Enthusiast and financial follower


# The future has two waves Preview and lookback on commodity Freifunk routers
## Overview - What is Freifunk - Hardware Recommendations - Available Hardware - How to deal with deprecated devices - Things you can do as a local community
## Freifunk - Decentralized Mesh-Networks - Organized as local communities - Engagement in politics and technology - Using commodity WiFi gear - Firmware based on OpenWrt
## What's wrong with todays recommendations? - Cheapest choice described as "Entry-level" - What does entry-level mean? - Recommendations often outdated - Why should an operator choose a specific hardware? - VPN performance the only measurement?
## What was recommended - MIPS single-core - Slow compared to e.g. PPC / ARM - Mostly 2.4GHz single-band - Congestion in cities is very bad - One primary hardware-vendor - Undesireable, as lock-out can happen any time
## How we should recommend - Enable the Operator to make informed decisions - Preselect compatible devices - Highlight key differences - Provide guidance when the operator has questions about their decision
## What do we want to recommend - Fast CPU - Gives room for additional services - Dualband WiFi - Making use of wider channels & less Congestion - Flexible choice on hardware-vendors - Redundancy in case of "Revision-Bingo"
## Freifunk-Effect ![](images/freifunk_effekt.png) Pricing graph for the ZyXEL NBG6617
## Current favorites - Qualcomm IPQ40xx - 4C/4T ARMv7 (717 MHz) - 256M RAM / 16M to 32M SPI Flash - 2T2R 802.11n / 802.11ac Wave 2 on 2.4GHz - 2T2R 802.11ac Wave 2 on 5GHz - MediaTek MT7621 (580 MHz) - 2C/4T MIPS 1004Kc (880 MHz) - 128M RAM / 16M SPI Flash - 2T2R 802.11n on 2.4GHz (MT7603) - 2T2R 802.11ac Wave 1 on 5GHz (MT7612)
## Observed Improvements - Wireless throughput - 20% increased WiFi throughput (QCA9882 compared to IPQ4019) - Tunnel performance - Double the throughput when using fastd as tunnel protocol
## Expected cost - Around 50€ to 70€ new depending on the exact model - Most reasonable choice
## Cheaper options - MediaTek MT7628 & MediaTek MT7612 - 1C/1T MIPS 24KEc - 256M RAM / 16M to 32M SPI Flash - 2T2R 802.11n on 2.4GHz - 2T2R 802.11ac Wave 1 on 5GHz (MT7612)
## Drawbacks - No CPU improvement - 64M RAM limited in terms of longevity - Amount of queues to manage double with two radios
## Expected cost - Around 25€ to 60€ new depending on the exact model - Can be the better suited option depending on the use-case - Outdoor, Ceiling-Mount
## Making recommendations - Hard to predict the future - Unforseen challenges may arise - Should remain operational for the next 5 years
## Making recommendations ![](images/recommendations_indoor.png)
## Making recommendations ![](images/recommendations_outdoor.png)
## Making recommendations ![](images/recommendations_cheap.png)
## Deprecated devices - Insufficient by todays standard - 4M Flash - 32M RAM - Remaining support is unclear - Primary base for many communities - However, first communities started active phase-out
## Software optimizations - Can be done without spending money on new hardware - Already many in place (in case of Gluon) - Only short-term improvements possible - Wireless limitations remain - See "Fight for the bytes! Fun with Four Megabytes Flash" 35c3 OIO
## Upgrading flash and RAM - Can fix stability issues - No support in upstream projects - Wireless limitations remain - Operators should be aware of the consequences
## Replacing devices with new devices - If chosen wisely, long-term benefit - Getting ready for the next 5+ years - Devices might not be suitable in terms of mounting etc. - Costly
## Replacing with retired business access-points - Most have more than enough RAM and flash - Sometimes really fast processor - Even 802.11ac gear can be found for cheap or even free - Often use OpenWrt already
## Replacing with retired enterprise access-points - Often just relabled/repackaged ODM boards - Watchguard, Fortinet, Sophos, Riverbed, devolo
## What to do - Treat the operator as competent enough to let him pick his hardware - Assist him in doing so - Trust the operator to do the installation process - Providing documentation is key - Freifunk is a long-term project, no one-shot - Hardware depends on use-case - no "one-size-fits-all"


| Test-dev | ||||
|---|---|---|---|---|
| Team | mAP | BFLOPs | PPF-b | PPF-a |
| [1]AlexNet in my heart | 0.515 | 0.0712 | 1.199 | 0.675 |
| [2]dcyhw | 0.586 | 5.68 | 0.027 | 0.519 |
| [3]Team Galactic | 0.479 | 0.466 | 0.106 | 0.405 |
| [4]zdi | 0.601 | 245.3 | 0.001 | 0.388 |
| [5]lazy-learners | 0.546 | 112.48 | 0.001 | 0.388 |
| [6]YuTeam | 0.492 | 7.5 | 0.008 | 0.343 |
| CVWC SSDv2 | 0.476 | 1.25 | 0.037 | 0.304 |
| [7]DeepBlueAI | 0.442 | 0.25 | 0.046 | 0.194 |
| CVWC SSDv1 | 0.426 | 1.2 | -0.003 | 0.125 |
| [8]bagh | 0.262 | 0.00546 | -30.776 | 0.111 |
| [9]eyeoftiger | 0.456 | 535 | 0.000 | 0.104 |
| [10]DelPro | 0.480 | N/A | N/A | 0 |
| [11]Bestfitting_NBU | 0.460 | N/A | N/A | 0 |
| [12]tony19 | 0.507 | N/A | N/A | 0 |
| [13], | 0.465 | N/A | N/A | 0 |
| [14]TeamEVAC | 0.014 | N/A | N/A | 0 |
| Full Test | ||||
|---|---|---|---|---|
| Team | mAP | BFLOPs | PPF-b | PPF-a |
| [1]AlexNet in my heart | 0.513 | 0.0712 | 1.169 | 0.675 |
| [2]dcyhw | 0.586 | 5.680 | 0.028 | 0.519 |
| [3]Team Galactic | 0.475 | 0.466 | 0.097 | 0.405 |
| [4]zdi | 0.601 | 245.3 | 0.001 | 0.388 |
| [5]lazy-learners | 0.548 | 112.48 | 0.001 | 0.388 |
| [6]YuTeam | 0.482 | 7.5 | 0.007 | 0.311 |
| CVWC SSDv2 | 0.473 | 1.25 | 0.034 | 0.304 |
| [7]DeepBlueAI | 0.432 | 0.25 | 0.009 | 0.194 |
| CVWC SSDv1 | 0.418 | 1.2 | -0.010 | 0.125 |
| [8]bagh | 0.259 | 0.00546 | -31.248 | 0.111 |
| [9]eyeoftiger | 0.459 | 535 | 0.000 | 0.104 |
| [10]DelPro | 0.480 | N/A | N/A | 0 |
| [11]Bestfitting_NBU | 0.460 | N/A | N/A | 0 |
| [12]tony19 | 0.507 | N/A | N/A | 0 |
| [13], | 0.465 | N/A | N/A | 0 |
| [14]TeamEVAC | 0.014 | N/A | N/A | 0 |
| Team | Members | Repo | Description |
|---|---|---|---|
| [1]AlexNet in my heart | heart/Batiary Orest Kupyn(Ukrainian Catholic University), Dzmitry Pranchuk(WANNABY), Volodymyr Budzan |
https://github.com/KupynOrest/AmurTigerCVWC | We used custom network architecture based on RetinaNet with MobileNetv1 backbone. To achieve greated efficiency we use Depthwise Separable Convolutions instead of regular one and smaller num of layers in localization/classification head. We train our net on 224 img size. As the second stage we also use knowledge distillation via pseudolabelling with large SE-ResNeXt-101 network. |
| [2]dcyhw | Jianwei Dong, Longrong Yang, Junjie Chen, Junqiang Huang, Xinxu Wei |
https://github.com/JwDong2019/CVWC-2019-FCOS | We solve the detection track by adopting FCOS which is proposed in CVPR 2019 and our backbone is resnet 50. We used COCO datasets for pretraining and deformable convolution is also added into our method for enhanced performance. |
| [3]Team Galactic | Wei Runchen, Luo Dawei, Yin Xiaojie |
https://github.com/RunchenWei/YOLO-mini-tiger | 1.We use YOLOv3 method based on Darknet framework, and its backbone is EfficientNet_b0( its structure have been adjusted to single label classification with small sample dataset.) The loss function is replaced with Generalized Intersection over Union Loss(GIoU Loss). 2.All of our submission was trained on Amur Tiger trainset without any tricks (without multi-scales or flip in traning and evaluation) and We use Gaussian distribution random initialization without any pretrained model. 3. We propose a new backbone structure adjustment algorithm to reduce the BFLOPs and model size in any backbone.( It is only used in single label classification with small sample dataset, it is different from prune algorithm ). |
| [4]zdi | Zonglin Di(TJU), Bingchen Zhao(TJU) |
https://github.com/ElegantLin/CVWC-2019 | The base net I used is Faster RCNN using HRNet as backbone from https://github.com/HRNet/HRNet-Object-Detection. The pretrained model is from ImageNet and I fine-tuned it with training set. We tried several tricks and the best mAP we got is 0.60009 with 245.3 GFLOPs. |
| [5]lazy-learners | Srinivas VARADHARAJAN (Dell EMC), Vish KAVASSERYRAJALINGAM (Samsung) |
<EMAIL_ADDRESS><EMAIL_ADDRESS>|
The model is based on ResNet feature extractor pre-trained on MS-COCO dataset, the detection head is a FasterRCNN based model. There were several data augmentations technique added to augment the training data size. Hyperparameter tuning was effectively done after multiple experiments. |
| [6]YuTeam | Yuanqiang Cai, Libo Zhang(ISCAS), Dawei Du |
https://github.com/yuchengtianxia/SLN_Final | We present a tiger detector, SLN(Final). The SLN is an anchor-free tiger detector. Its backbone network is MobileNetV1. It uses FPN and Deformable Convolution to fuse and modify features. It has light FLOPs (7.5B), training parameters(4,505,816), and model size (.data(72.2MB)+ .index(21.7KB)+.meta(3.3MB)). |
| [7]DeepBlueAI | Zhipeng Luo, Feng Ni, Zhenyu Xu, Yuehan yao, Bin Dong |
https://github.com/nemonameless/mmdettiger | We adopts MobileNetV2-SSDLite, achieving the trade-off between mAP and FLOPs by reducing 50% number of channels. We only use ImageNet pre-trained MobileNetV2 model. And we do not use multiple models, multi-scales or flip in the evaluation, just single model and single scale(300*300) for training and testing. We just use soft NMS for a little gain. |
| [8]bagh | saket kunwar | https://github.com/saketkunwar/cvwc2019_det | Model is yolov3-tiny with custom anchors determined from ground truth boxes. Pytorch was used for training using coco pretrained weights. But for inference the trained model was converted to intel openvino format with fixes for proper image re-scaling and anchor sizes. Yolov3 was also tested with pytorch and openvino but final submitted result on leader-board is yolov3-tiny. |
| [9]eyeoftiger | Anay Majee(Intel), Kshitij Agrawal(Intel) |
https://github.com/kshitijagrwl/tiger_detection | SSD-inceptionv2 We have used a vanila SSD network with an inception v2 backbone at a resolution of 300x300. The model is pretrained on COCO Detection task and finetuned for the ATRW dataset. |
| [10]DelPro | - | ||
| [11]Bestfitting_NBU | - | ||
| [12]tony19 |<EMAIL_ADDRESS>| ||
| [13], |<EMAIL_ADDRESS>| No Response | |
| [14]TeamEVAC | No Response |


Toggle navigation
SeaClouds Dashboard - Monitor Applications
0
This feature will be available in prior releases
Just now
See All Alerts
User Profile
Settings
This feature will be available in prior releases
Home
Module Profile Designer
Discoverer & Planner
Deployer
Monitor
Live monitor
SLA Service
Live Monitor
Available application metrics
Metric chooser
Entity
Name
Description
Selected


{% extends 'patterns.html' %} {# --------------------------------------- #} {# Settings, models, library variables #} {# --------------------------------------- #} {% model 'ptn-forms', as="form" %} {% set ui_title = "Forms" %} {% block ui_description %}
Examples of form types and layout. You can toggle error state examples by changing their variables in the ptn-forms.json file in Models. View source – or refer to provided source code for how to implement.
{% endblock %} {# --------------------------------------- #} {# Main body content #} {# --------------------------------------- #} {% block body %}


THE ORIGINS OF THE NATIONAL FRONT FOR THE HRD Peer
LIBERATION OF SOUTH VIET-NAM
by
Carlyle Alan Thayer
Thesis submitted for the degree of Doctor of Philosophy, in the Department of International Relations, Research School of Pacific Studies,
The Australian National University.
February 1977
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.


The You can explore Hindu mythology where you get to know about yugas and Avataras of each yuga.
The You can explore Yugas.


Problem-solving
Getting blocked on a simple problem and solving it
That time when I wrote one of my previous blog posts, saved the post file, updated my index file and index image, pushed to GitHub to make it live - and nothing happened. No update. Nothing. I kept hitting the refresh button (repeatedly and more and more forcefully), cursing the slow internet which in my mind meant that my updates hadn't been received (because if in doubt look for the fault in anything but your own actions right?). I even checked my file on GitHub which seemed to confirm that all fault was with the internet... until I eventually noticed that the new blog post was still set in comments... Everything was there, I just hadn't uncommented it. I'm expecting more moments like this over the next few months, missing semi-colons, quotation marks, wrong brackets, you name it. Lesson learnt: pay attention to details in my own code.
Getting blocked on a simple problem and solving it in an elegant way
That other time when... well let's be honest almost every time this week. There have been some moments when I was able to recall something learnt earlier and solve a problem by myself. But all in all this has been an immense learning curve. It's quite a challenge to get my head around JavaScript and almost every task required some form of external help. My main strategies where pseudocoding (tho significantly less elegant than what it could look like), simply trying something and either console logging or reading error messages (which is a challenge in itself as I lack the language at this stage to even fully understand most of it) and googling (though as with error messages understanding solutions when you're a begginner is somewhat difficult).
That being said, I made it so far and with every day/challenge I feel a little bit more able to read code, understand where I went wrong, how to look for help and so on - challenges and struggles are great for learning. And hindsight is awesome too...
What's the meaning of:
.map(): changes the elements of an array and then creates a new array with the changed elements
.filter(): returns elements from an array that fulfil a condition (evaluate to truthy) written within the block of the method (e.g. return only words of a certain length, or only numbers that are < 10 ...)
.reduce(): applies a function against an accumulator and each value of an array (left to right) to reduce it to a single value
Home


I have to admit that I have not done many projects before but I definitely want to try out more projects in the the near future.
This is my first project I have ever worked on in the group and quite fun as it helped me developed my HTML and CSS skills.
This project is were I went to my first Hackathon.


| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.io.output; | |
| 18 | ||
| 19 | import java.io.IOException; | |
| 20 | import java.io.OutputStream; | |
| 21 | import java.io.Serializable; | |
| 22 | import java.util.UUID; | |
| 23 | ||
| 24 | import org.apache.commons.io.TaggedIOException; | |
| 25 | ||
| 26 | /** | |
| 27 | * An output stream decorator that tags potential exceptions so that the | |
| 28 | * stream that caused the exception can easily be identified. This is | |
| 29 | * done by using the {@link TaggedIOException} class to wrap all thrown | |
| 30 | * {@link IOException}s. See below for an example of using this class. | |
| 31 | * <pre> | |
| 32 | * TaggedOutputStream stream = new TaggedOutputStream(...); | |
| 33 | * try { | |
| 34 | * // Processing that may throw an IOException either from this stream | |
| 35 | * // or from some other IO activity like temporary files, etc. | |
| 36 | * writeToStream(stream); | |
| 37 | * } catch (IOException e) { | |
| 38 | * if (stream.isCauseOf(e)) { | |
| 39 | * // The exception was caused by this stream. | |
| 40 | * // Use e.getCause() to get the original exception. | |
| 41 | * } else { | |
| 42 | * // The exception was caused by something else. | |
| 43 | * } | |
| 44 | * } | |
| 45 | * </pre> | |
| 46 | * <p> | |
| 47 | * Alternatively, the {@link #throwIfCauseOf(Exception)} method can be | |
| 48 | * used to let higher levels of code handle the exception caused by this | |
| 49 | * stream while other processing errors are being taken care of at this | |
| 50 | * lower level. | |
| 51 | * <pre> | |
| 52 | * TaggedOutputStream stream = new TaggedOutputStream(...); | |
| 53 | * try { | |
| 54 | * writeToStream(stream); | |
| 55 | * } catch (IOException e) { | |
| 56 | * stream.throwIfCauseOf(e); | |
| 57 | * // ... or process the exception that was caused by something else | |
| 58 | * } | |
| 59 | * </pre> | |
| 60 | * | |
| 61 | * @see TaggedIOException | |
| 62 | * @since 2.0 | |
| 63 | */ | |
| 64 | public class TaggedOutputStream extends ProxyOutputStream { | |
| 65 | ||
| 66 | /** | |
| 67 | * The unique tag associated with exceptions from stream. | |
| 68 | */ | |
| 69 | private final Serializable tag = UUID.randomUUID(); | |
| 70 | ||
| 71 | /** | |
| 72 | * Creates a tagging decorator for the given output stream. | |
| 73 | * | |
| 74 | * @param proxy output stream to be decorated | |
| 75 | */ | |
| 76 | public TaggedOutputStream(final OutputStream proxy) { | |
| 77 | super(proxy); | |
| 78 | } | |
| 79 | ||
| 80 | /** | |
| 81 | * Tests if the given exception was caused by this stream. | |
| 82 | * | |
| 83 | * @param exception an exception | |
| 84 | * @return {@code true} if the exception was thrown by this stream, | |
| 85 | * {@code false} otherwise | |
| 86 | */ | |
| 87 | public boolean isCauseOf(final Exception exception) { | |
| 88 |
1
1. isCauseOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return TaggedIOException.isTaggedWith(exception, tag); |
| 89 | } | |
| 90 | ||
| 91 | /** | |
| 92 | * Re-throws the original exception thrown by this stream. This method | |
| 93 | * first checks whether the given exception is a {@link TaggedIOException} | |
| 94 | * wrapper created by this decorator, and then unwraps and throws the | |
| 95 | * original wrapped exception. Returns normally if the exception was | |
| 96 | * not thrown by this stream. | |
| 97 | * | |
| 98 | * @param exception an exception | |
| 99 | * @throws IOException original exception, if any, thrown by this stream | |
| 100 | */ | |
| 101 | public void throwIfCauseOf(final Exception exception) throws IOException { | |
| 102 |
1
1. throwIfCauseOf : removed call to org/apache/commons/io/TaggedIOException::throwCauseIfTaggedWith → KILLED |
TaggedIOException.throwCauseIfTaggedWith(exception, tag); |
| 103 | } | |
| 104 | ||
| 105 | /** | |
| 106 | * Tags any IOExceptions thrown, wrapping and re-throwing. | |
| 107 | * | |
| 108 | * @param e The IOException thrown | |
| 109 | * @throws IOException if an I/O error occurs | |
| 110 | */ | |
| 111 | @Override | |
| 112 | protected void handleIOException(final IOException e) throws IOException { | |
| 113 | throw new TaggedIOException(e, tag); | |
| 114 | } | |
| 115 | ||
| 116 | } | |
Mutations | ||
| 88 |
1.1 |
|
| 102 |
1.1 |


docker network create
説明
ネットワークの生成
API 1.21 以上
このコマンドを利用するには、クライアントとデーモンの API はともに、最低でも
1.21
である必要があります。
クライアント上において docker version
コマンドを実行して、クライアントとデーモンの API バージョンを確認してください。
利用方法
docker network create [OPTIONS] NETWORK
追加説明
新たなネットワークを生成します。
The DRIVER
accepts bridge
or overlay
which are the
built-in network drivers. If you have installed a third party or your own custom
network driver you can specify that DRIVER
here also. If you don’t specify the
--driver
option, the command automatically creates a bridge
network for you.
When you install Docker Engine it creates a bridge
network automatically. This
network corresponds to the docker0
bridge that Engine has traditionally relied
on. When you launch a new container with docker run
it automatically connects to
this bridge network. You cannot remove this default bridge network, but you can
create new ones using the network create
command.
$ docker network create -d bridge my-bridge-network
Bridge networks are isolated networks on a single Engine installation. If you
want to create a network that spans multiple Docker hosts each running an
Engine, you must create an overlay
network. Unlike bridge
networks, overlay
networks require some pre-existing conditions before you can create one. These
conditions are:
- Access to a key-value store. Engine supports Consul, Etcd, and ZooKeeper (Distributed store) key-value stores.
- A cluster of hosts with connectivity to the key-value store.
- A properly configured Engine
daemon
on each host in the cluster.
The dockerd
options that support the overlay
network are:
--cluster-store
--cluster-store-opt
--cluster-advertise
To read more about these options and how to configure them, see “Get started with multi-host network”.
While not required, it is a good idea to install Docker Swarm to manage the cluster that makes up your network. Swarm provides sophisticated discovery and server management tools that can assist your implementation.
Once you have prepared the overlay
network prerequisites you simply choose a
Docker host in the cluster and issue the following to create the network:
$ docker network create -d overlay my-multihost-network
Network names must be unique. The Docker daemon attempts to identify naming conflicts but this is not guaranteed. It is the user’s responsibility to avoid name conflicts.
Overlay network limitations
You should create overlay networks with /24
blocks (the default), which limits
you to 256 IP addresses, when you create networks using the default VIP-based
endpoint-mode. This recommendation addresses
limitations with swarm mode. If you
need more than 256 IP addresses, do not increase the IP block size. You can
either use dnsrr
endpoint mode with an external load balancer, or use multiple
smaller overlay networks. See
Configure service discovery
for more information about different endpoint modes.
本コマンドの利用例については、以下に示す 利用例の節 を参照してください。
オプション
| 名前／省略形 | デフォルト | 説明 |
--attachable |
API 1.25+ Enable manual container attachment |
|
--aux-address |
Auxiliary IPv4 or IPv6 addresses used by Network driver | |
--config-from |
API 1.30+ The network from which copying the configuration |
|
--config-only |
API 1.30+ Create a configuration only network |
|
--driver , -d |
bridge |
Driver to manage the Network |
--gateway |
IPv4 or IPv6 Gateway for the master subnet | |
--ingress |
API 1.29+ Create swarm routing-mesh network |
|
--internal |
Restrict external access to the network | |
--ip-range |
Allocate container ip from a sub-range | |
--ipam-driver |
IP Address Management Driver | |
--ipam-opt |
Set IPAM driver specific options | |
--ipv6 |
Enable IPv6 networking | |
--label |
Set metadata on a network | |
--opt , -o |
Set driver specific options | |
--scope |
API 1.30+ Control the network’s scope |
|
--subnet |
Subnet in CIDR format that represents a network segment |
利用例
Connect containers
When you start a container, use the --network
flag to connect it to a network.
This example adds the busybox
container to the mynet
network:
$ docker run -itd --network=mynet busybox
If you want to add a container to a network after the container is already
running, use the docker network connect
subcommand.
You can connect multiple containers to the same network. Once connected, the
containers can communicate using only another container’s IP address or name.
For overlay
networks or custom plugins that support multi-host connectivity,
containers connected to the same multi-host network but launched from different
Engines can also communicate in this way.
You can disconnect a container from a network using the docker network
disconnect
command.
Specify advanced options
When you create a network, Engine creates a non-overlapping subnetwork for the
network by default. This subnetwork is not a subdivision of an existing
network. It is purely for ip-addressing purposes. You can override this default
and specify subnetwork values directly using the --subnet
option.  For overlay
networks and for network driver plugins that
support it you can create multiple subnetworks. This example uses two /25
subnet mask to adhere to the current guidance of not having more than 256 IPs in
a single overlay network. Each of the subnetworks has 126 usable addresses.
$ docker network create -d overlay \
--subnet=<IP_ADDRESS>/25 \
--subnet=<IP_ADDRESS>/25 \
--gateway=<IP_ADDRESS> \
--gateway=<IP_ADDRESS> \
--aux-address="my-router=<IP_ADDRESS>" --aux-address="my-switch=<IP_ADDRESS>" \
--aux-address="my-printer=<IP_ADDRESS>" --aux-address="my-nas=<IP_ADDRESS>" \
my-multihost-network
Be sure that your subnetworks do not overlap. If they do, the network create fails and Engine returns an error.
Bridge driver options
When creating a custom network, the default network driver (i.e. bridge
) has
additional options that can be passed. The following are those options and the
equivalent docker daemon flags used for docker0 bridge:
| Option | Equivalent | Description |
|---|---|---|
com.docker.network.bridge.name |
- | Bridge name to be used when creating the Linux bridge |
com.docker.network.bridge.enable_ip_masquerade |
--ip-masq |
Enable IP masquerading |
com.docker.network.bridge.enable_icc |
--icc |
Enable or Disable Inter Container Connectivity |
com.docker.network.bridge.host_binding_ipv4 |
--ip |
Default IP when binding container ports |
com.docker.network.driver.mtu |
--mtu |
Set the containers network MTU |
com.docker.network.container_interface_prefix |
- | Set a custom prefix for container interfaces |
The following arguments can be passed to docker network create
for any
network driver, again with their approximate equivalents to docker daemon
.
| Argument | Equivalent | Description |
|---|---|---|
--gateway |
- | IPv4 or IPv6 Gateway for the master subnet |
--ip-range |
--fixed-cidr |
Allocate IPs from a range |
--internal |
- | Restrict external access to the network |
--ipv6 |
--ipv6 |
Enable IPv6 networking |
--subnet |
--bip |
Subnet for network |
For example, let’s use -o
or --opt
options to specify an IP address binding
when publishing ports:
$ docker network create \
-o "com.docker.network.bridge.host_binding_ipv4"="<IP_ADDRESS>" \
simple-network
Network internal mode
By default, when you connect a container to an overlay
network, Docker also
connects a bridge network to it to provide external connectivity. If you want
to create an externally isolated overlay
network, you can specify the
--internal
option.
Network ingress mode
You can create the network which will be used to provide the routing-mesh in the
swarm cluster. You do so by specifying --ingress
when creating the network. Only
one ingress network can be created at the time. The network can be removed only
if no services depend on it. Any option available when creating an overlay network
is also available when creating the ingress network, besides the --attachable
option.
$ docker network create -d overlay \
--subnet=<IP_ADDRESS>/16 \
--ingress \
--opt com.docker.network.driver.mtu=9216 \
--opt encrypted=true \
my-ingress-network
上位コマンド
| コマンド | 説明 |
|---|---|
| docker network | Manage networks |
関連コマンド
| コマンド | 説明 |
| docker network connect | Connect a container to a network |
| docker network create | ネットワークの生成 |
| docker network disconnect | Disconnect a container from a network |
| docker network inspect | Display detailed information on one or more networks |
| docker network ls | List networks |
| docker network prune | Remove all unused networks |
| docker network rm | Remove one or more networks |


by {{recipe.author}}
We've grabbed all of the ingredients you need and put them directly into your shopping list. Take your time looking for more recipes and head over to the shopping list page when you are ready to print your shopping list.
{{recipe.description}}


Dim Sum
The dishes enjoyed with morning tea are called Dim Sum, and are usually served in a small bowl or basket.
We will give you everything you need .
The dishes enjoyed with morning tea are called Dim Sum, and are usually served in a small bowl or basket.
These tiny purse-shaped dumplings, which are a staple of Chinese dim sum, make the perfect party food.
Chinese people eat steamed buns at any meal, but they are especially popular at breakfast.
literally translatable as hot spicy soup, is a popular lunch for people who like to eat spicy food
Noodles are eaten for lunch throughout the country.
Dreamcatcher squid ennui cliche chicharros nes echo small batch jean ditcher meal...
The milky tofu is enriched with brownish red ground beef and chopped green onion
The major ingredients are diced chicken, dried chili, and fried peanuts.
Wontons are commonly boiled and served in soup


SchemaObject provides a simple, easy to use Python object interface to a MySQL database schema. You can effortlessly write tools to test, validate, sync, migrate, or manage your schema as well as generate the SQL necessary to make changes to it.
Verify all tables are InnoDB
import schemaobject
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb')
tables = schema.databases['mydb'].tables #or schema.selected.tables
for t in tables:
assert tables[t].options['engine'].value == 'InnoDB'
Verify our MySQL instance is at least version 5.1
import schemaobject
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb')
assert schema.version >= '5.1.0'
Notes and Limitations
Prerequisites
Standard Installation
Download SchemaObject-0.5.2
tar xvzf SchemaObject-0.5.2.tar.gz
cd SchemaObject-0.5.2
sudo python setup.py install
Installing with easy_install
sudo easy_install schemaobject
Installing the latest development version
git clone git://github.com/mmatuson/SchemaObject.git
cd schemaobject
sudo python setup.py install
To upgrade to a new version of SchemaObject, see Upgrading
Schema Sync - a MySQL schema versioning and migration utility
SchemaObject is under active development and released under the Apache License, Version 2.0.
You can obtain a copy of the latest source code from the Git repository, or fork it on Github.
You can report bugs via the SchemaObject Issues page.
Comments, questions, and feature requests can be sent to code at matuson dot com


Anya Pls is a group of hard-working individuals always ready to take on challenges with innovative solutions. We are experienced undergraduates with years of knowledge of programming and theories of computer science. All of us are deliverable in numerous programming languages and had prior Android application experience. We tackle real world problems with user-friendly and “Anya-pleasing” software. What is “Anya-pleasing” you might ask? Anya is our beloved professor at the University of Toronto that teaches us how to make a great product that will perform professionally and up to pace with the current industry. Our goal is to maximize user experience by filling the gaps of user demands. We will strive for a standard beyond a smile or applause. We strive to be “Anya-pleasing.”
Software Development
We have amongst the finest
Web Design
Whether from scratch or you want us to fix a webpage, let us know what we can, and we will surpass your expectations!
Get in touch
Main Office
Anya Pls, Inc.
1265 Military Trail
Toronto, ON M1C 1A4
P:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>on social networks


|
This test tests the assertion from the Namespaces in XML specification, "The namespace prefix, unless it is xml or xmlns, MUST have been declared in a namespace declaration attribute in either the start-tag of the element where the prefix is used or in an ancestor element (i.e. an element in whose content the prefixed markup occurs)." The root element doesn't declare the XML Event namespace for the prefix "ev".
The test has passed if handlers are implemented (the handler with xml:id="passhandler" has run) but the handler with xml:id="failhandler" has not run. If the handler is run then the text in the testcase will show "Test failed: magic prefixes!". If handlers are not implemented at all, the testcase will show "Test failed: handlers not implemented."
The test is also passed if the implementation states somehow that the test case is not namespace well formed (by overlaying it on the image, informing the user in the error console, not showing the document at all, etc.).


THE BIG HIT A film review by Matt Williams
RATING: * * * out of * * * *
The Big Hit is a ridiculous ultraviolent action spoof. It does not take itself seriously, and neither should you. It's not the typical action-comedy, but once you get adjusted to its unique rhythms, it becomes a hilarious satire.
Melvin Smiley (Mark Wahlberg) is a really nice guy. He just wants people to like him. The trouble is, he's a hitman. He's good at what he does, but his job leaves him with ulcers. To show what a nice guy he is, he's always giving money away. Two women are taking advantage of this human ATM: Melvin's fiancee Pam (Christina Applegate), and his girlfriend Chantel (Lela Rochon). Melvin would break up with them...but he thinks they might not like him anymore if he did that.
Another person who takes advantage of Melvin's generosity is Cisco (Lou Diamond Phillips). Melvin and Cisco both work as hitmen for Paris (Avery Brooks), but Melvin typically does all the work (Cisco just grabs the paychecks). When Cisco comes up with a money-making scheme, he knows just the guy to help him out: Melvin.
The two of them, along with Crunch (Bokeem Woodbine) and Gump (Robin Dunne), plan to kidnap Keiko Nishi (China Chow), the daughter of billionaire Jiro Nishi(Sab Shimono). But unforeseen complications ensue which will turn the kidnappers against one another.
If this sounds the slightest bit serious to you, ignore it. The film is a complete and absolute spoof. If you go in expecting a straightforward action pic (or even an action-comedy), you'll be tremendously disappointed.
That's not to say that there's not any action in the film. Director Kirk Wong delivers several fine action pieces that, although played firmly tongue-in-cheek, are very thrilling. However, they are subservient to the comedy (rather than the other way around). People expecting a Hong Kong style action-fest are heading for a letdown.
The comedy in the film doesn't aim very high. It's just a step-or-two away from the Airplane style of parody. But there are plenty of funny moments, mostly character based. Crunch's self-love affair, Cisco's stereotypical boat dream, and Marvin's video-store battles are still bringing me chuckles.
The film does have its failings. The characters of Pam's parents (Elliott Gould and Lainie Kazan) aren't nearly as funny as they try to be. And there are several moments when the dialogue in the film unintentionally crosses the boundary between bad-funny and bad-bad.
But, for the most part, The Big Hit is humorous when it counts. Again, I caution that you must be in the right frame of mind when seeing this film. But if you are, you should find it hilarious.
Copyright 1998 Matt Williams
- Matt Williams<EMAIL_ADDRESS>Reviewer for Cinematter: http://www.cinematter.com Home of over 500 reviews, and information on over 600 upcoming releases
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews