To identify unused tags in WordPress you can use the following snippet.
SELECT * From wp_terms terms INNER JOIN wp_term_taxonomy tax ON terms.term_id=tax.term_id WHERE tax.taxonomy='post_tag' AND tax.count=0;
To identify unused tags in WordPress you can use the following snippet.
SELECT * From wp_terms terms INNER JOIN wp_term_taxonomy tax ON terms.term_id=tax.term_id WHERE tax.taxonomy='post_tag' AND tax.count=0;
To get the size of all tables using MSSQL you can use the snippet below.
SELECT tab.NAME AS [Tablename], s.Name AS [Schema Name], part.rows AS [Count of Rows], SUM(a.total_pages) * 8 AS [Total Space in KB], SUM(a.used_pages) * 8 AS [Used Space in KB], (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS [Unused Space in KB] FROM sys.tables tab INNER JOIN sys.indexes idx ON tab.OBJECT_ID = idx.object_id INNER JOIN sys.partitions part ON idx.object_id = part.OBJECT_ID AND idx.index_id = part.index_id LEFT OUTER JOIN sys.schemas s ON tab.schema_id = s.schema_id INNER JOIN sys.allocation_units a ON part.partition_id = a.container_id WHERE tab.NAME NOT LIKE 'dt%' AND tab.is_ms_shipped = 0 AND idx.OBJECT_ID > 255 GROUP BY tab.Name, s.Name, part.Rows ORDER BY 4 DESC
To count the different words of a string in Python you can use the following snippet.
input = "Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. The language provides constructs intended to enable clear programs on both a small and large scale.Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library.Like other dynamic languages, Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts. Using third-party tools, such as Py2exe or Pyinstaller, Python code can be packaged into standalone executable programs. Python interpreters are available for many operating systems.CPython, the reference implementation of Python, is free and open source software and has a community-based development model, as do nearly all of its alternative implementations. CPython is managed by the non-profit Python Software Foundation." words = input.split(' ') wordcounter = {} for word in words: if word in wordcounter: wordcounter[word] += 1 else: wordcounter[word] = 1 sortedWords = sorted([(counter,word) for word,counter in wordcounter.items()],reverse=True) print "Word counts: " + str(sortedWords) print "Most popular word: " + str(sortedWords[0][1]) + " used " + str(sortedWords[0][0]) + " times."