Posts

Showing posts from October, 2014

FiveM License Key Code Example

Example 1: FiveM pc key code // its C# BTW :) // checks if INPUT_CONTEXT has just been released // assumes `using static CitizenFX.Core.API;` if ( IsControlJustReleased ( 1 , 51 ) ) { // run code here } Example 2: FiveM pc key code -- its Lua BTW : ) -- checks if INPUT_CONTEXT has just been released if IsControlJustReleased ( 1 -- [ [ input group ] ] , 51 -- [ [ control index ] ] ) then -- run code here end

Scrollbar Opacity 0 Css Code Example

Example: css opacity from 0 to 1 @keyframes fadein { from { opacity : 0 ; } to { opacity : 1 ; } }

Set Width Of Img In Html Center Code Example

Example: image align center .center { display : block ; margin-left : auto ; margin-right : auto ; width : 50 % ; }

Androidx MutliDex: The Number Of Method References In A .dex File Cannot Exceed 64K

Answer : Modify the module-level build.gradle file to enable multidex and add the multidex library as a dependency, as shown here: android { defaultConfig { ... minSdkVersion 16 targetSdkVersion 28 multiDexEnabled true } ... } dependencies { implementation 'com.android.support:multidex:1.0.3' } If you do not override the Application class, edit your manifest file to set android:name in the tag as follows: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp"> <application android:name="android.support.multidex.MultiDexApplication" > ... </application> </manifest> If you do override the Application class, change it to extend MultiDexApplication (if possible) as follows: ... import androidx.multidex.M

Arduino Serial Read And Write Code Example

Example: arduino serial write /* Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Syntax Serial.write(val) Serial.write(str) Serial.write(buf, len) Parameters Serial: serial port object. val: a value to send as a single byte. str: a string to send as a series of bytes. buf: an array to send as a series of bytes. len: the number of bytes to be sent from the array. */

2N2222A Mismatch Between Emitter And Collector

Image
Answer : There really isn't a single '2N2222' transistor, since each manufacturer just seems to use XYZ_2N2222 as a part number for a generic 'NPN silicon amplifier transistor'. Hence the 2N2222 pin-out is sadly not standardized. Most 2N2222s have the orientation which your diagram shows, where if the flat side is facing you, the pins are E-B-C respectively. However, some manufacturers have the pins going C-B-E for the TO-92 package. For example, the ON Semi P2N2222A variant: datasheet You can determine the pinout and NPN/PNP of an unknown BJT with the diode function of a digital multimeter in seconds. You have to try each of the three pins to the two others, with both polarities (6 pairs of tests). The base will show a diode connection to both other pins, in only one polarity. No other pin will show that. If the red test lead is on the base, then it is NPN, if the black is on the base, then it is PNP. Now you have identified the base pin and whether it

Js With W3 Code Example

Example: javascript let str = 'Hello World' ; console. log ( str ) ;

C Clean Buffer Code Example

Example: c clear buffer void clearBuffer ( ) { char c ; do { c = getchar ( ) ; } while ( c != '\n' && c != EOF ) ; }

Create A Flutter Desktop Project In Android Studio Code Example

Example: flutter desktop support $ flutter channel dev $ flutter upgrade $ flutter config --enable- < platform > -desktop

No Indent Latex Code Example

Example: no indentation latex \usepackage { parskip } % http : //ctan.org/pkg/parskip \setlength { \parindent } { 0 pt } \noindent

Transparent Color In Hexadecimal Code Example

Example: hex color transparent background-color : #ffffff80 ; < --- 80 is 50 % opacity /*r g b a*/ # ff ff ff 80 ; Converted values : 100 % — FF 99 % — FC 98 % — FA 97 % — F7 96 % — F5 95 % — F2 94 % — F0 93 % — ED 92 % — EB 91 % — E8 90 % — E6 89 % — E3 88 % — E0 87 % — DE 86 % — DB 85 % — D9 84 % — D6 83 % — D4 82 % — D1 81 % — CF 80 % — CC 79 % — C9 78 % — C7 77 % — C4 76 % — C2 75 % — BF 74 % — BD 73 % — BA 72 % — B8 71 % — B5 70 % — B3 69 % — B0 68 % — AD 67 % — AB 66 % — A8 65 % — A6 64 % — A3 63 % — A1 62 % — 9 E 61 % — 9 C 60 % — 99 59 % — 96 58 % — 94 57 % — 91 56 % — 8 F 55 % — 8 C 54 % — 8 A 53 % — 87 52 % — 85 51 % — 82 50 % — 80 49 % — 7 D 48 % — 7 A 47 % — 78 46 % — 75 45 % — 73 44 % — 70 43 % — 6 E 42 % — 6 B 41 % — 69 40 % — 66 39 % — 63 38 % — 61 37 % — 5 E 36 % — 5 C 35 % — 59 34 % — 57 33 % — 54 32 % — 52 31 % — 4 F 30 % — 4 D 29 % — 4 A 28 % — 47 27 % — 45 26 % — 42 25 % — 40

Converting LinearSVC's Decision Function To Probabilities (Scikit Learn Python )

Image
Answer : scikit-learn provides CalibratedClassifierCV which can be used to solve this problem: it allows to add probability output to LinearSVC or any other classifier which implements decision_function method: svm = LinearSVC() clf = CalibratedClassifierCV(svm) clf.fit(X_train, y_train) y_proba = clf.predict_proba(X_test) User guide has a nice section on that. By default CalibratedClassifierCV+LinearSVC will get you Platt scaling, but it also provides other options (isotonic regression method), and it is not limited to SVM classifiers. I took a look at the apis in sklearn.svm.* family. All below models, e.g., sklearn.svm.SVC sklearn.svm.NuSVC sklearn.svm.SVR sklearn.svm.NuSVR have a common interface that supplies a probability: boolean, optional (default=False) parameter to the model. If this parameter is set to True, libsvm will train a probability transformation model on top of the SVM's outputs based on idea of Platt Scaling. The form of transformation is similar to a lo

Css Input Rounded Corners Code Example

Example 1: css rounded corners /* Set rounded corners with border-radius property */ .class { border-radius : 4 px ; } .circle { border-radius : 50 % ; } Example 2: how to make borders rounded in css #rcorners { border-radius : 25 px ; } Example 3: How to make a round corner in CSS #roundCornerID { border-radius : 30 % ; width : 200 px ; height : 150 px ; } Example 4: how to round input border border-radius : px , %

Could Not Autowire. No Beans Of 'String' Type Found. Code Example

Example 1: could not autowire no beans of type found in springbootapplication @Repository public interface YourRepository ... ... @Service public classe YourClassService Example 2: could not autowire no beans of type found @ComponentScan(basePackages={"path.to.my.components","path.to.my.othercomponents"}) dans le mvc.xml modifier la racine base package ex : com.projet => com.projet.* les alertes sont ainsi suppr = les composants sont bien pris en compte

Example Grid Tailwind

Example 1: tailwind grid <div class= "grid grid-cols-3 gap-4" > <div> 1 </div> <!-- ... --> <div> 9 </div> </div> Example 2: tailwind css image grid ########### Responsive Grids ############### <div class= "flex flex-wrap" > <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/6 mb-4 bg-gray-500" ></div> <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/6 mb-4 bg-gray-400" ></div> <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/6 mb-4 bg-gray-500" ></div> <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/6 mb-4 bg-gray-400" ></div> <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/2 xl:w-1/6 mb-4 bg-gray-500" ></div> <div class= "w-full sm:w-1/2 md:w-1/3 lg:w-1/2 xl:w-1/6 mb-4 bg-gray-400" ></div> </div> Example 3: tailwind grid <div class= "gri

CSS Tranform:translateY From JavaScript

Answer : You can pass any transform property as a string. HOW? It can be done like this; div.style.transform = "translate(x,y)" I find out that if I write div.style.transform = "translate(someValue)" It only affects x axes. "translate-y(someValue)" or "translate-x(someValue)" did not work out. Or you can use rotate property; div.style.transform = "rotate(50px)". Try it! https://jsfiddle.net/araknafobia/4wtxu0dr/1/ In addition to the accepted answer, it is also possible to target the each axis separately - such as in the following example: div.style.transform = "translateY(10px)"; Again, the value in the parentheses can be anything that would otherwise work when specified directly in CSS.