Posts

Showing posts from February, 2018

Active Directory Time Synchronisation - Time-Service Event ID 50

Answer : Here is my recommended configuration for Windows Domain Time Synchronization, pieced together from several Microsoft TechNet articles and blog posts. If your servers are virtualized, do not use any of the VMware tools time sync features. Just let the Windows Time Service (w32time) do its job. VMware even says so. I assume the same is true for Hyper-V. Furthermore, if you have the both the VM tools and the Windows Time Service attempting to manage the system clock, you can end up with a "tug-of-war" situation where your clock will keep jumping around and never be accurate. Your Primary Domain Controller Emulator should be manually configured to sync with multiple external NTP servers (four is a good number). Using multiple NTP source provides redundancy and serves as a sanity check in case one server starts sending bad time data (it has happened before). The Active Directory assumes your PDCe is the central authoritative time source for your network.

Angular No Provider For Formbuilder Code Example

Example: No provider for FormBuilder import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @NgModule({ imports: [ ... FormsModule, ReactiveFormsModule, ... ] })

Binary To String/Text In Python

Answer : It looks like you are trying to decode ASCII characters from a binary string representation (bit string) of each character. You can take each block of eight characters (a byte), convert that to an integer, and then convert that to a character with chr() : >>> X = "0110100001101001" >>> print(chr(int(X[:8], 2))) h >>> print(chr(int(X[8:], 2))) i Assuming that the values encoded in the string are ASCII this will give you the characters. You can generalise it like this: def decode_binary_string(s): return ''.join(chr(int(s[i*8:i*8+8],2)) for i in range(len(s)//8)) >>> decode_binary_string(X) hi If you want to keep it in the original encoding you don't need to decode any further. Usually you would convert the incoming string into a Python unicode string and that can be done like this (Python 2): def decode_binary_string(s, encoding='UTF-8'): byte_string = ''.join(chr(int(s[i*8:i*8+8]

Can You Use The LIKE Operator In SOQL Queries Via The REST API?

Answer : Yes you can. SOQL in the rest API supports all the same constructs that its SOAP older brother does. Remember to pass the SOQL as the 'q' parameter in the URL,and to URLEncode the soql when putting it in the query, e.g. https://na1.salesforce.com/services/data/v25.0/query?q=select+id+from+account I think the issue is with the url encoding of the % in the like clause. I just tried the following in the Workbench Rest API and it worked. /services/data/v25.0/query?q=select+id+from+account+where+BillingState+like+'VIC%25'

9 Cm To.inches Code Example

Example: cm to inches const cm = 1 ; console . log ( `cm : $ { cm } = in : $ { cmToIn ( cm ) } ` ) ; function cmToIn ( cm ) { var in = cm / 2.54 ; return in ; }

Bootstrap Infobox Example

Example 1: bootstrap errors < div class = " alert alert-primary " role = " alert " > This is a primary alert—check it out! </ div > < div class = " alert alert-secondary " role = " alert " > This is a secondary alert—check it out! </ div > < div class = " alert alert-success " role = " alert " > This is a success alert—check it out! </ div > < div class = " alert alert-danger " role = " alert " > This is a danger alert—check it out! </ div > < div class = " alert alert-warning " role = " alert " > This is a warning alert—check it out! </ div > < div class = " alert alert-info " role = " alert " > This is a info alert—check it out! </ div > < div class = " alert alert-light " role = " alert " > This is a light alert—check it out

Cat Girl Text Art Code Example

Example: cat text art _ | \ | | | | |\ | | /, ~\ / / X `-.....-------./ / ~-. ~ ~ | \ / | \ /_ ___\ / | /\ ~~~~~ \ | | | \ || | | |\ \ || ) (_/ (_/ ((_/

What Does String Npos Stand For Code Example

Example: what is string::npos npos is a constant static member value with the greatest possible value for an element of type size_t . This value , when used as the value for a len parameter in string ' s member functions , means until the end of the string . . . . As a return value , it is usually used to indicate that no matches were found in the string

Chemistry - Benzene To Phenol In A Single Step

Answer : Solution 1: The reaction of benzene over \ce V 2 O 5 / P t A u \ce{V2O5/ PtAu} \ce V 2 O 5/ Pt A u catalyst at lower temperatures, can convert benzene to phenol with some success. See this book here Direct hydroxylation of benzene [The original question before editing was: What is the Ratta Maar Reaction?] Someone has played a prank with you with the named reaction. "Ratta maar" is a slang for "rote memorization" in Hindi/Urdu, which implies keep on memorizing without understanding and perhaps this is what your teacher wanted too. I assume this Allen's Chemistry Handbook is being taught or used in India. Solution 2: The terminology given to that reaction by your instructors is very odd. But the more important thing is that \ce V 2 O 5 \ce{V_2O_5} \ce V 2 ​ O 5 ​ isn't a reagent in converting benzene directly to phenol, rather it is a catalyst. The first few pages of the book linked by @M.Farooq writes [...] Various sources have

Check Ros Version In Our Computer Code Example

Example: how to know my ros version echo $ROS_DISTRO

Obtain A Palindrome By Replacing ? Python Code Code Example

Example 1: string palindrome in python n = input ( "Enter the word and see if it is palindrome: " ) #check palindrome if n == n [ :: - 1 ] : print ( "This word is palindrome" ) else : print ( "This word is not palindrome" ) Example 2: palindrome python # A palindrome is a word , number , phrase , or other sequence of characters which reads the same backward as forward . # Ex : madam or racecar . def is_palindrome ( w ) : if w == w [ :: - 1 ] : # w [ :: - 1 ] it will reverse the given string value . print ( "Given String is palindrome" ) else : print ( "Given String is not palindrome" ) is_palindrome ( "racecar" )

Android Java.security.cert.CertPathValidatorException: Trust Anchor For Certification Path Not Found

Answer : I am answering to this to give an idea about the scenario and solution as per the android developer site for others benefit. I have solved this using custom trust manager. The problem was with the server certificate, it misses intermediate certificate authority. However with the first flow certificate path is completed somehow and result was successful certificate path validation. There is a solution for this in android developer site. it suggest to use custom trust manager that trusts this server certificate or it suggest to server to include the intermediate CA in the server chain. custom trust manager. source: https://developer.android.com/training/articles/security-ssl.html#UnknownCa // Load CAs from an InputStream // (could be from a resource or ByteArrayInputStream or ...) CertificateFactory cf = CertificateFactory.getInstance("X.509"); // From https://www.washington.edu/itconnect/security/ca/load-der.crt InputStream caInput = new BufferedInputStream
Note This plugin is part of the fortinet.fortios collection (version 1.1.8). To install it use: ansible-galaxy collection install fortinet.fortios . To use it in a playbook, specify: fortinet.fortios.fortios_dlp_settings . New in version 2.8: of fortinet.fortios Synopsis Requirements Parameters Notes Examples Return Values Synopsis This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify dlp feature and settings category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0 Requirements The below requirements are needed on the host that executes this module. ansible>=2.9.0 Parameters Parameter Choices/Defaults Comments access_token string Token-based authentication. Generated from GUI of Fortigate. dlp_settings dictionary Designate logical storage for DLP fingerprint database. cache_mem_percent integer

Appendix Latex Overleaf Code Example

Example: appendices latex \documentclass{article} \usepackage[title]{appendix} \begin{document} \section{title 1} \section{title 2} \begin{appendices} \section{Some Notation} \section{Some More Notation} \end{appendices} \end{document}

Array Of Object Id Mongoose Code Example

Example: mongoose schema type var schema = new Schema ( { name : String , binary : Buffer , living : Boolean , updated : { type : Date , default : Date . now } , age : { type : Number , min : 18 , max : 65 } , mixed : Schema . Types . Mixed , _someId : Schema . Types . ObjectId , decimal : Schema . Types . Decimal128 , array : [ ] , ofString : [ String ] , ofNumber : [ Number ] , ofDates : [ Date ] , ofBuffer : [ Buffer ] , ofBoolean : [ Boolean ] , ofMixed : [ Schema . Types . Mixed ] , ofObjectId : [ Schema . Types . ObjectId ] , ofArrays : [ [ ] ] , ofArrayOfNumbers : [ [ Number ] ] , nested : { stuff : { type : String , lowercase : true , trim : true } } , map : Map , mapOfString : { type : Map , of : String } } ) // example use var Thing = mongoose . model ( 'Thing' , schema ) ; var m = new Thing ; m . name = '

Check If Argparse Optional Argument Is Set Or Not

Answer : I think that optional arguments (specified with -- ) are initialized to None if they are not supplied. So you can test with is not None . Try the example below: import argparse as ap def main(): parser = ap.ArgumentParser(description="My Script") parser.add_argument("--myArg") args, leftovers = parser.parse_known_args() if args.myArg is not None: print "myArg has been set (value is %s)" % args.myArg As @Honza notes is None is a good test. It's the default default , and the user can't give you a string that duplicates it. You can specify another default='mydefaultvalue , and test for that. But what if the user specifies that string? Does that count as setting or not? You can also specify default=argparse.SUPPRESS . Then if the user does not use the argument, it will not appear in the args namespace. But testing that might be more complicated: args.foo # raises an AttributeError hasattr(args,

Cassandra NoHostAvailable: Error In CQLSH

Answer : This is too late to answer. But I wanted to share my experience. If you have a single node cluster and use NetworkTopologyStrategy, then it throws this error. Check your keyspace configuration. Error during inserting data: NoHostAvailable: My CQL command to update the replication ALTER KEYSPACE my_keyspace WITH replication = {'class' : 'NetworkTopologyStrategy', 'DC1' : 1 ,'DC2' :2 }; was slightly different from the config files : conf/cassandra-rackdc.properties # These properties are used with GossipingPropertyFileSnitch and will # indicate the rack and dc for this node dc=dc1 rack=rack1 resulting in a cqlsh: my_keyspace> select * from world where message_id = 'hello_world'; NoHostAvailable: the replication strategy is case sensitive and copy/paste from documentation may lead you to a mistake. Fix : Changing the replication info so that it match the config files ALTER KEYSPACE my_keyspace WITH replication

Animations In LaTeX

Image
Answer : Since the OP asks for creating an animated PDF using the animate package without the need to have the animation frames in a separate (PDF) file, the tikzpicture environment can be directly put into an animateinline environment: \documentclass{article} \usepackage{animate} \usepackage{tikz} \usetikzlibrary{lindenmayersystems} \pgfdeclarelindenmayersystem{A}{% \symbol{F}{\pgflsystemstep=0.6\pgflsystemstep\pgflsystemdrawforward} \rule{A->F[+A][-A]} } \begin{document} \begin{animateinline}[controls,autoplay,loop]{2} \multiframe{8}{n=1+1}{ \begin{tikzpicture}[scale=10,rotate=90] \draw (-.1,-.2) rectangle (.4,0.2); \draw [blue,opacity=0.5,line width=0.1cm,line cap=round] l-system [l-system={A,axiom=A,order=\n,angle=45,step=0.25cm}]; \end{tikzpicture} } \end{animateinline} \end{document} There are two things here, to produce a gif file (which we do here normally, in this site for uploading). to have the animation inside the pdf file. For

Can't Connect To Heroku Postgresql Database From Local Node App With Sequelize

Answer : OK, found the answer by browsing sequelize source code : https://github.com/sequelize/sequelize/blob/master/lib/dialects/postgres/connection-manager.js#L39 To activate SSL for PG connections you don't need native: true or ssl: true but dialectOptions.ssl: true so the following did finally work: sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', protocol: 'postgres', dialectOptions: { ssl: true } }); You no longer need to parse the DATABASE_URL env variable, there is a Sequelize constructor which accepts the connection URL: sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', protocol: 'postgres', dialectOptions: { ssl: true } }); One needs to add dialectOptions under ssl "development": { "username": process.env.DB_USERNAME, "password": process.env.DB_PASSWORD, "database": proce