More

Query out a specific date regardless of the time, using python


Problem: I have a feature class with an attribute table with a field called Edited_Date and its data in the field is as follows: 4/8/2015 10:00:00 PM. I want to select all records that are Edited_Date is 4/8/2015 regardless of the time of day. SO I want to use a wildcard to substitute the hour minutes seconds and PM.

I run the following code using python to select records by Edited_Date but no records are being selected. I've tried different formats but none is working and I can't find the proper syntax to query pout a date such as

Code:

arcpy.SelectLayerByAttribute_management("Plant_Layer", "NEW_SELECTION", " [last_edited_date] = '4/8/2015' + '%s' ")

What is the syntax to do this in Python? Select a date regardless of the time.


Generating Geographic Terms for Streaming Videos Using Python: A Comparative Analysis

In libraries, the relationship between textual descriptions of audiovisual material and access to that material is a primary concern, as users expect to have access to all the library’s resources—which increasingly include audiovisual content—through a simple and effective web interface. At UW-Oshkosh, library staff developed a unique site for its streaming video collection that would allow users to search for videos and browse collections on particular topics across each of the three vendors. In order to create more meaningful and topical collections, various programming tools and techniques were employed to identify geographical locations in vendor-supplied MARC records. This article describes three different methods for generating geographic terms for streaming videos using different Python libraries and evaluates them based on the number of terms generated, overlap in terms generated between the three methods, and the amount of cleanup needed to generate useful geographic terms.


Here are the reasons for using exceptions in Python:

  • Exception handling allows you to separate error-handling code from normal code.
  • An exception is a Python object which represents an error.
  • As with code comments, exceptions helps you to remind yourself of what the program expects.
  • It clarifies the code and enhances readability.
  • Allows you to stimulate consequences as the error-handling takes place at one place and in one manner.
  • An exception is a convenient method for handling error messages.
  • In Python, you can raise an exception in the program by using the raise exception method.
  • Raising an exception helps you to break the current code execution and returns the exception back to expection until it is handled.
  • Processing exceptions for components which can't handle them directly.

Canonical Advanced Query Syntax in Windows 7

Canonical syntax was introduced for keywords in Windows 7. An example of a query with a canonical property is System.Message.FromAddress:[email protected] . When coding queries in applications running on Windows 7 and later, you must use canonical syntax to programmatically generate AQS queries. If you do not use canonical syntax and your application is deployed in a locale or UI language different from the language in the application code, your queries will not be interpreted correctly.

The conventions for canonical keyword syntax are as follows:

  • The canonical syntax for a property is its canonical name, such as System.Photo.LightSource . Canonical names are not case sensitive.
  • The canonical syntax for the Boolean operators consists of the keywords AND, OR, and NOT, in all uppercase.
  • The operators <, >, =, and so forth, are not localized and are thus also part of the canonical syntax.
  • If a property P has enumerated values or ranges named N₁ through Nₖ, the canonical syntax for the Ith value or range is the canonical name for P, followed by the character #, followed by NI, as illustrated in the following example:
    • System.Photo.LightSource#Daylight , System.Photo.LightSource#StandardA , and so forth.
    • System.Devices.LaunchDeviceStageFromExplorer:=System.StructuredQueryType.Boolean#True
    • System.Author:sanjay
    • System.Keywords:"Animal"
    • System.FileCount:>100

    There is no canonical syntax for numbers in Windows 7 and later. Because floating point formats vary among locales, the use of a canonical query that involves a floating point constant is not supported. Integer constants, in contrast, can be written using only digits (no separators for thousands) and can be safely used in canonical queries in Windows 7 and later.

    Examples

    The following table shows some examples of canonical properties and the syntax for using them.

    Type of canonical property Example Syntax
    String value System.Author
    The string value is searched for in the author property:
    System.Author:Jacobs
    Enumeration range System.Priority The priority property can have a numerical value range:
    System.Priority:System.Priority#High
    Boolean System.IsDeleted
    Boolean values can be used with any Boolean property:
    System.IsDeleted:System.StructuredQueryType.Boolean#True , and System.IsDeleted:System.StructuredQueryType.Boolean#False
    Numerical System.Size
    It is not possible to write safely a canonical query that involves a floating point constant, because floating point formats vary among locales. Integers must be written with no separators for thousands. For example:
    System.Size:<12345

    For more information about canonical properties and the property system generally, see System Properties. Alternatively, refer to the public header files.

    Query Operators

    If a property, p, has multiple values for some item, an AQS query for p: returns the item if is true for at least one of the values. ( represents a restriction.)

    The syntax listed in the following table consists of an operator, operator symbol, example and example description. The operator and symbol can be used in any language and included in any query. Do not use the COP_IMPLICIT or COP_APPLICATION_SPECIFIC operators. Some of the operators have interchangeable symbols.


    Contents

    Elizabeth Feinler and her team (who had created the Resource Directory for ARPANET) were responsible for creating the first WHOIS directory in the early 1970s. [3] Feinler set up a server in Stanford's Network Information Center (NIC) which acted as a directory that could retrieve relevant information about people or entities. [4] She and the team created domains, with Feinler's suggestion that domains be divided into categories based on the physical address of the computer. [5]

    The process of registration was established in RFC 920. WHOIS was standardized in the early 1980s to look up domains, people, and other resources related to domain and number registrations. As all registration was done by one organization at that time, one centralized server was used for WHOIS queries. This made looking up such information very easy.

    At the time of the emergence of the internet from the ARPANET, the only organization that handled all domain registrations was the Defense Advanced Research Projects Agency (DARPA) of the United States government (created during 1958. [6] ). Responsibility of domain registration remained with DARPA as the ARPANET became the Internet during the 1980s. UUNET began offering domain registration service however, they simply handled the paperwork which they forwarded to the DARPA Network Information Center (NIC). Then the National Science Foundation directed that management of Internet domain registration would be handled by commercial, third-party entities. InterNIC was formed in 1993 under contract with the NSF, consisting of Network Solutions, Inc., General Atomics and AT&T. The General Atomics contract was canceled after several years due to performance issues.

    20th century WHOIS servers were highly permissive and would allow wild-card searches. A WHOIS query of a person's last name would yield all individuals with that name. A query with a given keyword returned all registered domains containing that keyword. A query for a given administrative contact returned all domains the administrator was associated with. Since the advent of the commercialized Internet, multiple registrars and unethical spammers, such permissive searching is no longer available.

    On December 1, 1999, management of the top-level domains (TLDs) com, net, and org was assigned to ICANN. At the time, these TLDs were converted to a thin WHOIS model. Existing WHOIS clients stopped working at that time. A month later, it had self-detecting Common Gateway Interface support so that the same program could operate a web-based WHOIS lookup, and an external TLD table to support multiple WHOIS servers based on the TLD of the request. This eventually became the model of the modern WHOIS client.

    By 2005, there were many more generic top-level domains than there had been in the early 1980s. There are also many more country-code top-level domains. This has led to a complex network of domain name registrars and registrar associations, especially as the management of Internet infrastructure has become more internationalized. As such, performing a WHOIS query on a domain requires knowing the correct, authoritative WHOIS server to use. Tools to do WHOIS domain searches have become common. [ citation needed ]

    CRISP and IRIS Edit

    In 2003, an IETF committee was formed to create a new standard for looking up information on domain names and network numbers: Cross Registry Information Service Protocol (CRISP). [7] Between January 2005 and July 2006, the working name for this proposed new standard was Internet Registry Information Service (IRIS) [8] [9] The initial IETF Proposed Standards RFCs for IRIS are:

    • 3981 -
    • Newton, A. Sanz, M. (January 2005). IRIS: The Internet Registry Information Service (IRIS) Core Protocol. IETF. doi: 10.17487/RFC3981 . STD 8. RFC3981 . Retrieved June 1, 2015 .
    • 3982 -
    • Newton, A. Sanz, M. (January 2005). IRIS: A Domain Registry (dreg) Type for the Internet Registry Information Service (IRIS). IETF. doi: 10.17487/RFC3982 . RFC3982 . Retrieved June 1, 2015 .
    • 3983 -
    • Newton, A. Sanz, M. (January 2005). Using the Internet Registry Information Service (IRIS) over the Blocks Extensible Exchange Protocol (BEEP). IETF. doi: 10.17487/RFC3983 . RFC3983 . Retrieved June 1, 2015 .
    • 4992 -
    • Newton, A. (August 2007). XML Pipelining with Chunks for the Internet Registry Information Service. IETF. doi: 10.17487/RFC4992 . RFC4992 . Retrieved June 1, 2015 .

    The status of RFCs this group worked on can be found on the IETF Tools site. [10]

    Note: The IETF CRISP working group is not to be confused with the Number Resource Organization's (NRO) Team of the same name "Consolidated RIR IANA Stewardship Proposal Team" (CRISP Team). [13]

    WEIRDS and RDAP Edit

    In 2013, the IETF acknowledged that IRIS had not been a successful replacement for WHOIS. The primary technical reason for that appeared to be the complexity of IRIS. Further, non-technical reasons were deemed to lie in areas upon which the IETF does not pass judgment. Meanwhile, ARIN and RIPE NCC managed to serve WHOIS data via RESTful web services. The charter (drafted in February 2012) provided for separate specifications, for number registries first and for name registries to follow. [14] The working group produced five proposed standard documents:

    • 7480 -
    • Newton, Andrew Ellacott, Byron Kong, Ning (March 2015). HTTP Usage in the Registration Data Access Protocol (RDAP). IETF. doi: 10.17487/RFC7480 . RFC7480 . Retrieved July 8, 2015 .
    • 7481 -
    • Hollenbeck, Scott Kong, Ning (March 2015). Security Services for the Registration Data Access Protocol (RDAP). IETF. doi: 10.17487/RFC7481 . RFC7481 . Retrieved July 8, 2015 .
    • 7482 -
    • Newton, Andrew Hollenbeck, Scott (March 2015). Registration Data Access Protocol (RDAP) Query Format. IETF. doi: 10.17487/RFC7482 . RFC7482 . Retrieved July 8, 2015 .
    • 7483 -
    • Newton, Andrew Hollenbeck, Scott (March 2015). JSON Responses for the Registration Data Access Protocol (RDAP). IETF. doi: 10.17487/RFC7483 . RFC7483 . Retrieved July 8, 2015 .
    • 7484 -
    • Blanchet, Marc (March 2015). Finding the Authoritative Registration Data (RDAP) Service. IETF. doi: 10.17487/RFC7484 . RFC7484 . Retrieved July 8, 2015 .

    and an informational document:

    The WHOIS protocol had its origin in the ARPANET NICNAME protocol and was based on the NAME/FINGER Protocol, described in RFC 742 (1977). The NICNAME/WHOIS protocol was first described in RFC 812 in 1982 by Ken Harrenstien and Vic White of the Network Information Center at SRI International.

    WHOIS was originally implemented on the Network Control Program (NCP) but found its major use when the TCP/IP suite was standardized across the ARPANET and later the Internet.

    The protocol specification is the following (original quote): [15]

    The command line server query is normally a single name specification. i.e. the name of a resource. However, servers accept a query, consisting of only the question mark (?) to return a description of acceptable command line formats. Substitution or wild-card formats also exist, e.g., appending a full-stop (period) to the query name returns all entries beginning with the query name.

    On the modern Internet, WHOIS services are typically communicated using the Transmission Control Protocol (TCP). Servers listen to requests on the well-known port number 43. Clients are simple applications that establish a communications channel to the server, transmit a text record with the name of the resource to be queried and await the response in form of a sequence of text records found in the database. This simplicity of the protocol also permits an application, and a command line interface user, to query a WHOIS server using the Telnet protocol.

    Augumentings Edit

    In 2014, June ICANN published the recommendation for status codes, the "Extensible Provisioning Protocol (EPP ) domain status codes" [16]

    Once deletion occurs, the domain is available for re-registration in accordance with the registry's policies.

    WHOIS lookups were traditionally performed with a command line interface application, but now many alternative web-based tools exist.

    A WHOIS database consists of a set of text records for each resource. These text records consists of various items of information about the resource itself, and any associated information of assignees, registrants, administrative information, such as creation and expiration dates.

    Two data models exist for storing resource information in a WHOIS database, the thick and the thin model.

    Thin and thick lookups Edit

    WHOIS information can be stored and looked up according to either a thick or a thin data model:

    Thick A Thick WHOIS server stores the complete WHOIS information from all the registrars for the particular set of data (so that one WHOIS server can respond with WHOIS information on all .org domains, for example). Thin A Thin WHOIS server stores only the name of the WHOIS server of the registrar of a domain, which in turn has the full details on the data being looked up (such as the .com WHOIS servers, which refer the WHOIS query to the registrar where the domain was registered).

    The thick model usually ensures consistent data and slightly faster queries, since only one WHOIS server needs to be contacted. If a registrar goes out of business, a thick registry contains all important information (if the registrant entered correct data, and privacy features were not used to obscure the data) and registration information can be retained. But with a thin registry, the contact information might not be available, and it could be difficult for the rightful registrant to retain control of the domain. [17]

    If a WHOIS client did not understand how to deal with this situation, it would display the full information from the registrar. Unfortunately, the WHOIS protocol has no standard for determining how to distinguish the thin model from the thick model.

    Specific details of which records are stored vary among domain name registries. Some top-level domains, including com and net, operate a thin WHOIS, requiring domain registrars to maintain their own customers' data. The other global top-level registries, including org, operate a thick model. [18] Each country-code top-level registry has its own national rules.

    Software Edit

    The first applications written for the WHOIS information system were command-line interface tools for Unix and Unix-like operating systems (i.e. Solaris, Linux etc.). WHOIS client and server software is distributed as free open-source software and binary distributions are included with all Unix-like systems. Various commercial Unix implementations may use a proprietary implementation (for example, Solaris 7).

    A WHOIS command line client passes a phrase given as an argument directly to the WHOIS server. Various free open source examples can still be found on sites such as sourceforge.net. However, most modern WHOIS tools implement command line flags or options, such as the -h option to access a specific server host, but default servers are preconfigured. Additional options may allow control of the port number to connect on, displaying additional debugging data, or changing recursion/referral behavior.

    Like most TCP/IP client–server applications, a WHOIS client takes the user input and then opens an Internet socket to its destination server. The WHOIS protocol manages the transmission of the query and reception of results.

    Web Edit

    With the advent of the World Wide Web and especially the loosening up of the Network Solutions monopoly, looking up WHOIS information via the web has become quite common. At present, popular web-based WHOIS-queries may be conducted from ARIN, [20] RIPE [21] and APNIC. [22] Most early web-based WHOIS clients were merely front-ends to a command-line client, where the resulting output just gets displayed on a web page with little, if any, clean-up or formatting.

    Currently, web based WHOIS clients usually perform the WHOIS queries directly and then format the results for display. Many such clients are proprietary, authored by domain name registrars.

    The need for web-based clients came from the fact that command-line WHOIS clients largely existed only in the Unix and large computing worlds. Microsoft Windows and Macintosh computers had no WHOIS clients installed by default, so registrars had to find a way to provide access to WHOIS data for potential customers. Many end-users still rely on such clients, even though command line and graphical clients exist now for most home PC platforms. Microsoft provides the Sysinternals Suite that includes a whois client at no cost.

    CPAN has several Perl modules available that work with WHOIS servers. Many of them are not current and do not fully function with the current (2005) WHOIS server infrastructure. However, there is still much useful functionality to derive including looking up AS numbers and registrant contacts. [ citation needed ]

    WHOIS services are mainly run by registrars and registries for example the Public Interest Registry (PIR) maintains the .ORG registry and associated WHOIS service. [23]

    Regional Internet registries Edit

    WHOIS servers operated by regional Internet registries (RIR) can be queried directly to determine the Internet service provider responsible for a particular resource.

    The records of each of these registries are cross-referenced, so that a query to ARIN for a record which belongs to RIPE will return a placeholder pointing to the RIPE WHOIS server. This lets the WHOIS user making the query know that the detailed information resides on the RIPE server. In addition to the RIRs servers, commercial services exist, such as the Routing Assets Database used by some large networks (e.g., large Internet providers that acquired other ISPs in several RIR areas).

    Server discovery Edit

    There is currently no standard for determining the responsible WHOIS server for a DNS domain, though a number of methods are in common use for top-level domains (TLDs). Some WHOIS lookups require searching the procuring domain registrar to display domain owner details.

    Normally the contact information of the resources assignee is returned. However, some registrars offer private registration, in which case the contact information of the registrar is shown instead.

    Some registry operators are wholesalers, meaning that they typically provide domain name services to a large number of retail registrars, who in turn offer them to consumers. For private registration, only the identity of the wholesale registrar may be returned. In this case, the identity of the individual as well as the retail registrar may be hidden.

    Below is an example of WHOIS data returned for an individual resource holder. This is the result of a WHOIS query of example.com:

    Referral Whois (RWhois) is an extension of the original Whois protocol and service. RWhois extends the concepts of Whois in a scalable, hierarchical fashion, potentially creating a system with a tree-like architecture. Queries are deterministically routed to servers based on hierarchical labels, reducing a query to the primary repository of information. [24]

    Lookups of IP address allocations are often limited to the larger Classless Inter-Domain Routing (CIDR) blocks (e.g., /24, /22, /16), because usually only the regional Internet registries (RIRs) and domain registrars run RWhois or Whois servers, although RWhois is intended to be run by even smaller local Internet registries, to provide more granular information about IP address assignment.

    RWhois is intended to replace Whois, providing an organized hierarchy of referral services where one could connect to any RWhois server, request a look-up and be automatically re-directed to the correct server(s). However, while the technical functionality is in place, adoption of the RWhois standard has been weak.

    RWhois services are typically communicated using the Transmission Control Protocol (TCP). Servers listen to requests on the well-known port number 4321.

    Rwhois was first specified in RFC 1714 in 1994 by Network Solutions, [24] but the specification was superseded in 1997 by RFC 2167. [25]

    The referral features of RWhois are different than the feature of a Whois server to refer responses to another server, which RWhois also implements.

    One criticism of WHOIS is the lack of full access to the data. [26] [27] Few parties have realtime access to the complete databases.

    Others cite the competing goal of domain privacy as a criticism, although this problem is strongly mitigated by domain privacy services. Currently, the Internet Corporation for Assigned Names and Numbers (ICANN) broadly requires that the mailing address, phone number and e-mail address of those owning or administering a domain name to be made publicly available through the "WHOIS" directories. The registrant's (domain owner's) contact details, such as address and telephone number, are easily accessible to anyone who queries a WHOIS server. However, that policy enables spammers, direct marketers, identity thieves or other attackers to loot the directory for personal information about these people. Although ICANN has been exploring changing WHOIS to enable greater privacy, there is a lack of consensus among major stakeholders as to what type of change should be made. [28] Some domain registrars offer private registrations (also known as domain privacy), by which the contact information of the registrar is shown instead of the customer's. With the offer of private registration from many registrars, some of the risk has been mitigated. [29]

    Studies have shown that spammers can and do harvest plain-text email addresses from WHOIS servers. [30] For this reason, some WHOIS servers and websites offering WHOIS queries have implemented rate-limiting systems, such as web-based CAPTCHA and limited amounts of search queries per user IP address. [29]

    The WHOIS requirements conflict with the General Data Protection Regulation (GDPR), effective in the European Union 25 May 2018, which places strict regulations on the processing and publication of personally identifiable information. ICANN stated in November 2017 that it would not reprimand "noncompliance with contractual obligations related to the handling of registration data" if registrars provide alternative solutions for compliance with its rules, until the WHOIS requirements are updated to take GDPR into account. [29] [31]

    The WHOIS protocol was not written with an international audience in mind. A WHOIS server and/or client cannot determine the text encoding in effect for the query or the database content. Many servers were originally using US-ASCII and Internationalization concerns were not taken into consideration until much later. [32] This might impact the usability or usefulness of the WHOIS protocol in countries outside the USA. [1] In the case of internationalized domain names it is the responsibility of the client application to perform the translation of the domain name between its native language script and the DNS name in punycode.

    In cases where the registrant's (Domain Owner) identity is public, anyone can easily confirm the status of a domain via WHOIS.

    In the case of private registrations, ascertaining registration information may be more difficult. If a registrant, who acquired a domain name, wants to verify the registrar has completed the registration process, three steps may be required:

    1. Perform a WHOIS and confirm that the resource is at least registered with ICANN,
    2. Determine the name of the wholesale registrar, and
    3. Contact the wholesaler and obtain the name of the retail registrar.

    This provides some confidence that the retailer actually registered the name. But if the registrar goes out of business, as with the failure of RegisterFly in 2007, the rightful domain holder with privacy-protected registrations may have difficulty regaining the administration of their domain name. [17] Registrants using "private registration" can attempt to protect themselves by using a registrar that places customer data in escrow with a third party.

    ICANN requires that every registrant of a domain name be given the opportunity to correct any inaccurate contact data associated with their domain. For this reason, registrars are required to periodically send the holder the contact information on record for verification, but they do not provide any guarantee about the accuracy of information if the registrant provided inaccurate information.

    WHOIS has generated policy issues in the United States federal government. As noted above, WHOIS creates a privacy issue which is also tied to free speech and anonymity. However, WHOIS is an important tool for law enforcement officers investigating violations like spam and phishing to track down the holders of domain names. As a result, law enforcement agencies have sought to make WHOIS records both open and verified: [33]

    • The Federal Trade Commission has testified about how inaccurate WHOIS records thwart their investigations. [34]
    • Congressional hearings have been conducted about the importance of WHOIS in 2001, 2002 and 2006. [35]
    • The Fraudulent Online Identity Sanctions Act[36] "make it a violation of trademark and copyright law if a person knowingly provided, or caused to be provided, materially false contact information in making, maintaining, or renewing the registration of a domain name used in connection with the violation," [37] where the latter "violation" refers to a prior violation of trademark or copyright law. The act does not make the submission of false WHOIS data illegal in itself, only if used to shield oneself from prosecution for crimes committed using that domain name.

    The Expert Working Group (EWG) of the Internet Corporation for Assigned Names and Numbers (ICANN) recommended on 24 June 2013 that WHOIS should be scrapped. It recommends that WHOIS be replaced with a system that keeps information secret from most Internet users, and only discloses information for "permissible purposes". [38] ICANN's list of permissible purposes includes domain-name research, domain-name sale and purchase, regulatory enforcement, personal data protection, legal actions, and abuse mitigation. [39] Although WHOIS has been a key tool of journalists in determining who was disseminating certain information on the Internet, [40] the use of WHOIS by the free press is not included in ICANN's proposed list of permissible purposes.

    The EWG collected public input on the initial report until 13 September 2013. Its final report was issued on 6 June 2014, without meaningful changes to the recommendations. [41] As of March 2015 [update] , ICANN is in the "process of re-inventing WHOIS," working on "ICANN WHOIS Beta." [42] [43]


    GUI Project Ideas

    In this section, you&rsquoll see project ideas for Graphical User Interfaces. These project ideas can be classified as entertainment, finance, and utility tools.

    Here&rsquos are the project ideas:

    MP3 Player

    Audio is as important as text today if not more important. Since audio files are digital files, you&rsquoll need a tool that can play them. Without a player, you&rsquoll never be able to listen to the contents of an audio file.

    This is where the MP3 Player comes in. The MP3 Player is a device for playing MP3s and other digital audio files. This MP3 Player GUI project idea attempts to emulate the physical MP3 Player. You can build software that allows you play an MP3 files on your desktop or laptop computer.

    When you are done building the MP3 Player project, users can play their MP3 files and other digital audio files without having to purchase a physical MP3 Player. They&rsquoll be able to play the MP3 files using their computers.

    Examples of MP3 Players

    Here are some implementations of the MP3 Player idea:

    Technical Details

    The main objective of this project is to allow users to play MP3 and digital audio files. To be engaging for users, the application has to have a simple but beautiful user interface.

    You can have an interface for listing the available MP3 files. You can also give users the option to list other digital audio files that are not MP3.

    The users will also expect the MP3 Player to have an interface that shows information on the file that is playing. Some of the information you can include are the name of the file, its length, the amount played, and the amount not played, in minutes and seconds.

    Python has libraries that can play audio files, such as pygame , which allows you to work with multimedia files in few lines of code. You can also check out pymedia and simpleaudio .

    These libraries can handle a lot of digital audio files. They can handle other file types, not just the MP3 files.

    You can also implement a feature that allows users to create a playlist. To do this, you&rsquoll need a database to store information on the created playlists. Python&rsquos sqlite3 module allows you to use the SQLite database.

    The SQLite database is a better option in this case, because it is file based and easier to set up than other SQL databases. While SQLite is file based, it is better for saving data than a regular file.

    Extra Challenge

    For a more exciting challenge, you can add a feature to allow the MP3 player to repeat currently playing files or even shuffle the list of files to be played.

    It&rsquos also possible to implement a feature that allows users to increase and decrease the playing speed of the audio file. Users will find this interesting, as they&rsquoll be able to play files at a slower or faster pace than usual.

    Alarm Tool

    As they say, &ldquoTime and tide wait for no man.&rdquo But with a lot of things going on in our lives, it&rsquos difficult to not lose track of time. To be able to keep track of time, a reminder is needed.

    This is where the Alarm Tool comes in. An alarm is a device that gives an audio or visual signal about a certain condition. This Alarm Tool project idea is an attempt to build an alarm as software. The Alarm Tool gives an audio signal when a certain condition is met. The set time is the certain condition in this case.

    With the Alarm Tool, users can set alarms to remind them of things at certain times of the day. The Alarm Tool project will work from the user&rsquos laptop or desktop device, so they do not have to purchase a physical timer.

    Examples of Alarm Tools

    Here are some implementations of the Alarm Tool idea:

    Technical Details

    The main objective of this project is to activate audio signals at certain times of the day. So, timing and the audio signal to be played are the most important parts of the Alarm Tool.

    The Alarm Tool should allow users to create, edit, and delete alarms. It should also have an interface that lists all the alarms, provided they have not being deleted by the user. So, it should list the active and inactive alarms.

    Since it is an alarm, the application has to play tones at the set time. There are libraries for playing audio, like the pygame library.

    In your code logic, the application has to keep checking for set alarm times. When the time is reached, it triggers a function to play the alarm tone.

    Since the application will check for set alarm times, it means the application has to save the alarms in a database. The database should store things like the alarm date, time, and tone location.

    Extra Challenge

    As an extra feature, you can allow users to set recurring alarms. They&rsquoll be able to set alarms that will ring at a certain time on certain days of the week, every week. As an example, an alarm can be set at 2:00 PM every Monday.

    You can also add a snooze feature, so your users can snooze alarms instead of only dismissing them.

    File Manager

    The number of files on the personal computer of an average PC user is pretty high. If all of those files were placed in a single directory, it would be difficult to navigate and find files or directories. So, there is a need to arrange the files and manage them properly.

    This is where a file manager comes in. A file manager allows users to manage files and directories through a user interface. While files can be managed through the command-line, not all users know how to do that.

    With a file manager, users can arrange, access, and administer their files and directories properly without knowing how to use the command line. Some of the tasks a file manager allows users to perform includes copying, moving, and renaming files or directories.

    Examples of File Manager Tools

    Here are some implementations of the File Manager idea:

    Technical Details

    The main objective of the file manager project is to give users an interface to manage their files. Users want a file manager that has a file management tool that looks good and is easy to use.

    You can use the PySimpleGUI library to create unique user interfaces with a powerful widget, without having to deal with a lot of complexity.

    Your users should be able to perform simple tasks like creating new directories or empty text files. They should also be able to copy and move files or directories.

    The sys , os , and shutil libraries will be quite useful for this project, as they can be used to execute actions on the files in the background, while the user clicks away.

    The grid and list views are popular views today, so you can implement both in the application. This gives the user the option to choose which view option is suitable for them.

    Extra Challenge

    To make the file manager a bit more advanced, you can implement a search feature. So users can search for files and directories without having to find them manually.

    You can also implement a sort feature. This will allow users to sort files according to different orders, such as time, alphabetical order, or size.

    Expense Tracker

    We have daily expenses, from groceries to clothing to bills. There are so many expenses that it&rsquos normal to lose track of them and keep spending till we&rsquore almost out of cash. A tracker can help people watch their expenses.

    This is where the expense tracker comes in. An expense tracker is a software tool that allows users to keep track of their expenses. It can also analyze the expenses, depending on how advanced it is, but let&rsquos keep it simple for now.

    With the expense tracker, users can set a budget and track their spending so as to make better financial decisions.

    Examples of Expense Trackers

    Here are some implementations of the Expense Tracker idea:

    Technical Details

    The main objective of this project is to keep track of the user&rsquos expenses. Some statistical analysis has to be done to be able to give users correct information on their expenses and help them spend better.

    While tracking the expenses is the key thing, a good interface is also important. With PySimpleGUI , you can create a unique interface to improve the experience of the users.

    PyData libraries such as pandas and matplotlib can be helpful for building the expense tracker.

    The pandas library can be used for the data analysis, and the matplotlib library can be used for plotting graphs. Graphs will give the users a visual representation of their expenses, and a visual representation is usually easier to understand.

    The application will receive data from the users. The data here is the inputted expenses. So, you&rsquoll have to store the expenses in a database. The SQLite database is a good database choice for this project since it can be set up quickly. You can use sqlite3 module for the SQLite database.

    Extra Challenge

    For your users to benefit from this project, they&rsquoll have to input their expenses regularly, which might slip their mind. It could be useful for you to implement a reminder feature. So the application will send a notification at certain times of the day or the week, reminding them to make use of the expense tracker.


    The evolution of a design

    Inter-node communication in an rqlite cluster has evolved over the years, and it’s interesting to see the 3 design patterns in context. What do I mean by inter-node communication in this case? I mean the transmission of information specific to rqlite itself between cluster nodes, but not the Raft-specific communication between the Hashicorp code.

    The first thing to understand is that each rqlite node exposes two network interfaces — first, a Raft network address managed by the Hashicorp Raft system, and second, a HTTP API which clients use to query the SQLite database. From the client’s point-of-view, the Raft network address is an implementation detail, it’s only there for clustering functionality.

    While each node knows the Raft network address of every other node thanks to the Hashicorp Raft implementation, each rqlite node must also learn the HTTP URL of the Leader, so it can inform client code where to redirect queries. And since the Leader can change and even be completely replaced, each rqlite node must have up-to-date information regarding the Leader HTTP URL at all times.

    The core challenge is that this information about HTTP URLs is not something the Hashicorp Raft handles intrinsically, because the Raft layer only knows about Raft network addresses. The HTTP URLs are an rqlite concept, not a Raft concept.

    Therefore it’s up to the rqlite code to deal with redirecting clients to the Leader’s HTTP URL, if servicing a client’s request requires contact with the Leader (not all queries involve the Leader, but most do).

    How this is done has evolved over time.

    Pattern 1: Clients must search for the Leader

    Pictured above is a 3-node rqlite cluster. With rqlite 2.x if clients contacted a Follower, the Follower returned information the client could use to find the Leader, but the client might have to contact every other node in the process to determine which was Leader.

    Before version 3.x, rqlite nodes returned the Raft network address of the Leader to the client, if the requested operation could only be served by the Leader (assuming the node itself wasn’t the Leader). This forced the client to check all other cluster nodes, to see which one had the relevant Raft address, and then redirect the query itself to that node’s HTTP API URL.

    While this meant the rqlite code was much simpler than later versions, this approach only worked if the client knew about every node in the rqlite cluster, or always knew which node was Leader. This was not very practical, especially if nodes in the cluster changed or failed. There was no surefire, yet simple, way the client code could be informed of those changes, so clients could effectively lose touch with clusters.

    Pattern 2: Nodes communicate HTTP API URLs via Raft consensus

    In 3.x, 4.x, and 5.x rqlite nodes used Raft consensus to map Raft network addresses to HTTP API URLs, for every node. If a client contacted a Follower, the Follower knew the HTTP URL of the Leader (via the mapping that was updated and managed via Raft consensus), and returned that to the client. It generally worked, but the implementation didn’t prove to be robust in the long term.

    By version 3.0 it was clear that rqlite Follower nodes needed to return proper HTTP redirects. But the question then became how would Follower nodes know the HTTP URL of the Leader, at all times, regardless of any changes that happen to the cluster?

    Versions 3.x, 4.x, and 5.x used the Raft consensus system itself to broadcast this information. When a node joined the cluster it would commit a change to the Raft log, updating the configuration that mapped Raft network addresses to HTTP API URLs. Thanks to the Raft consensus system every node always knows every other node’s Raft network address so, in theory, each node could learn every other node’s HTTP API URL via this mapping. And therefore every node knew the Leader’s HTTP API URL, even across Leader changes.

    This design worked well for a long time, but had some shortcomings. One possible problem was what to do if a node joined the cluster, but then failed to update its HTTP API URL mapping (for whatever reason). It could happen since it was two distinct changes to the Raft system, but was very unlikely. But if it did, the cluster could need significant manual intervention before it could recover.

    Over time other bugs were discovered which showed this approach wasn’t robust when cluster membership changed regularly. This design also required operators to explicitly remove failed nodes from the cluster configuration, or the Raft-address-to-HTTP-URL mapping could become stale. Ultimately this design meant extra state, in addition to the SQLite database, was being stored via Raft. And more state means more chance for bugs.

    So while this approach worked well enough for years for versions 3.x, 4.x, and 5.x, by version 6.0 a better way had been identified. So instead of fixing the bugs, the design was reworked to render the bugs moot.

    Pattern 3: Followers query the Leader on demand

    In 6.x if a client contacts a Follower, the Follower will query the Leader on demand for the Leader’s HTTP URL, return that to the client, and then the client will contact the Leader directly. The design is stateless and Raft consensus is not involved.

    In version 6.0, a Follower contacts the Leader on demand, when it needs to know the Leader’s HTTP API. And critically it contacts the Leader over the Raft TCP connection, a connection that must always be present anyway — without that connection the node is not part of the cluster, and the cluster has bigger issues. So this new design doesn’t introduce any new failure modes, though it does introduce an extra network hop.

    This type of design is also stateless, and even if reaching out to the Leader to learn its HTTP API URL fails, that failure happens at query time — meaning the client can be informed and the client can decide how to handle it. Most likely the client can simply retry the request, if the error is transient.

    You can find further details on the design on 6.0 in the CHANGELOG.


    QUICK START EXAMPLES

    Here are some really simple examples to get you started using the API!

    • Volume timeline of coverage mentioning "islamic state" over the last 3 months. This is one of the most basic kinds of visualizations and tracks the percent of all online coverage worldwide in all 65 languages that GDELT monitored over the last 3 months that contained the phrase "islamic state" anywhere in the article. This particular example uses the special "timelinevolinfo" mode that produces a popup as you mouse over the timeline that shows you the top 10 most relevant articles at each timestep.
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=%22islamic%20state%22&mode=timelinevolinfo&TIMELINESMOOTH=5
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=%22donald%20trump%22&mode=tonechart
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=imagewebtag:%22donald%20trump%22&mode=imagecollageinfo&maxrecords=150
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(imagewebtag:%22drone%22%20OR%20imagewebtag:%22uav%22)&mode=imagecollageinfo&maxrecords=150
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(imagewebtag:%22red%20cross%22%20OR%20imageocrmeta:%22red%20cross%22)&mode=imagecollageinfo&maxrecords=150
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(imagetag:%22flood%22%20OR%20imagetag:%22rubble%22%20OR%20imagetag:%22earthquake%22%20OR%20imagetag:%22fire%22)&mode=imagecollageinfo&maxrecords=150&timespan=1week
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(imagetag:%22flood%22%20OR%20imagetag:%22rubble%22%20OR%20imagetag:%22earthquake%22%20OR%20imagetag:%22fire%22)&mode=artlist&maxrecords=100&timespan=1week
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(%22islamic%20state%22%20OR%20isis%20OR%20daesh)&mode=artlist&maxrecords=100&timespan=1week
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(%22wildlife%20crime%22%20OR%20poaching%20OR%20%22illegal%20fishing%22%20OR%20%22wildlife%20trade%22)&mode=artlist&maxrecords=100&timespan=1week
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(%22climate%20change%22%20OR%20%22global%20warming%22)&mode=artlist&maxrecords=200&timespan=1h&sort=datedesc&format=rssarchive
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=%22climate%20change%22&mode=artgallery
      • URL: https://api.gdeltproject.org/api/v2/doc/doc?query=(imagetag:%22pollution%22%20OR%20imagetag:%22smog%22%20OR%20imagetag:%22litter%22%20OR%20imagewebtag:%22smog%22%20OR%20imagewebtag:%22pollution%22%20OR%20imagewebtag:%22litter%22)&mode=imagegallery

      Prerequisites to LinkedIn Scraping:

      For this tutorial, and just like we did for the Amazon Scraper, we will stick to using basic Python and a couple of python packages – requests and lxml. We will not use more complicated packages like Scrapy in this tutorial.

      You will need to install the following:

      • Python 2.7 available here ( https://www.python.org/downloads/ )
      • Python Requests available here ( http://docs.python-requests.org/en/master/user/install/) . You might need Python pip to install this available here – https://pip.pypa.io/en/stable/installing/)
      • Python LXML ( Learn how to install that here – http://lxml.de/installation.html )

      The TimeZoneInfo class

      The TimeZoneInfo class represents any of the Earth's time zones, and enables the conversion of any date and time in one time zone to its equivalent in another time zone. The TimeZoneInfo class makes it possible to work with dates and times so that any date and time value unambiguously identifies a single point in time. The TimeZoneInfo class is also extensible. Although it depends on time zone information provided for Windows systems and defined in the registry, it supports the creation of custom time zones. It also supports the serialization and deserialization of time zone information.

      In some cases, taking full advantage of the TimeZoneInfo class may require further development work. If date and time values are not tightly coupled with the time zones to which they belong, further work is required. Unless your application provides some mechanism for linking a date and time with its associated time zone, it's easy for a particular date and time value to become disassociated from its time zone. One method of linking this information is to define a class or structure that contains both the date and time value and its associated time zone object.

      To take advantage of time zone support in .NET, you must know the time zone to which a date and time value belongs when that date and time object is instantiated. The time zone is often not known, particularly in web or network apps.