Posts

Showing posts from August, 2002

Can A Fake Second Display Be Enabled In Windows 10?

Answer : Just spent last two hours trying to figure this out. First go to Control Panel (not Settings app) Go to Adjust Screen Resolution. You will get a similar window as you did in Windows 7. Click Detect Go to display Drop Down and select "Display Device on VGA" Select Desired Resolution. If windows is unable to save your settings use the software from your video card to adjust the resolution. If you aren't able to output the display to the Fake screen only, Press Windows+P and the select "Second display only" I hope this helps. This is by far not the ideal solution, but for now it will do: I put a 102 Ohm resistor across pins 2 and 7 of my VGA port (also known as the headless Mac Mini trick), and Windows 10 now believes I have a second monitor attached. On a different computer I had to use pins 1 and 6 and reboot before the "monitor" would work. I had the same problem and came up with a fairly simple solution: Just connect your p

Converting Pfx To Pem Using Openssl

Answer : Another perspective for doing it on Linux... here is how to do it so that the resulting single file contains the decrypted private key so that something like HAProxy can use it without prompting you for passphrase. openssl pkcs12 -in file.pfx -out file.pem -nodes Then you can configure HAProxy to use the file.pem file. This is an EDIT from previous version where I had these multiple steps until I realized the -nodes option just simply bypasses the private key encryption. But I'm leaving it here as it may just help with teaching. openssl pkcs12 -in file.pfx -out file.nokey.pem -nokeys openssl pkcs12 -in file.pfx -out file.withkey.pem openssl rsa -in file.withkey.pem -out file.key cat file.nokey.pem file.key > file.combo.pem The 1st step prompts you for the password to open the PFX. The 2nd step prompts you for that plus also to make up a passphrase for the key. The 3rd step prompts you to enter the passphrase you just made up to store decrypted. The 4th puts it all t

Css Font Border Only Code Example

Example 1: text border css h1 { -webkit-text-stroke : 1 px black ; } Example 2: put an border around an text in css text-shadow : 2 px 0 0 #fff , -2 px 0 0 #fff , 0 2 px 0 #fff , 0 -2 px 0 #fff , 1 px 1 px #fff , -1 px -1 px 0 #fff , 1 px -1 px 0 #fff , -1 px 1 px 0 #fff ;

How To Write Comments In Html5 Code Example

Example 1: commenting in html <!-- a comment in html --> Example 2: html how to add comment <!-- This is the first comment , it won't be shown on a page --> <h1>And this is a header. It will be fully visible.</h1> <!-- Multiline comment. You can place a lot of information there. Maybe even a whole book. --> Example 3: how to create comments in html5 Insert a single-line , or multi-line comment. Comments are designated by the tags <! -- and --> Use the comment function to hide scripts on unsupported browsers . If you are programming in JavaScript or VBScript , you can use the comment function to hide the script on browsers that don't support it. Insert the comment at the start of the script , and end it with //--> to ensure that the script works on browsers that do support it. Example 4: how do i comment in htmle <div> <p>This text is visible. Check the source code for multi-line comment.</p> <!-- Hello , world

Yt Mp3 Converter Online Code Example

Example: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3

Add Pygame Module In PyCharm IDE

Answer : Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is: Download the appropriate interpreter with PyGame included Open your PyCharm IDE (Make sure it is up to date) Go to File Press Settings (Or Ctrl + Alt + S) Double click on the option that looks like Project: Name_of_Project Click on Project Interpreter Choose the interpreter you want to use that includes PyGame as a module Save your options And you are ready to go! Here is an alternate (I have never done this, please try to test it) Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in a specific file placed by you during installation/upgrade) Please consider putting your PyCharm stuff inside a folder for easy access. I hope this helps you! For PyCharm 2017 do the following: File - Settings Double click on y

Buildozer Failed To Execute The Last Command

Answer : First raise the log level = 2 in buildozer.spec ,then it will show all logs and error clearly. Here in .buildozer/android/platform/python-for-android/dist/myapp/python 2.7 build.py was missing. To fix this issue run this command buildozer android clean and then rebuild it using buildozer android debug or automatically run using buildozer android debug deploy run . Probably you are running an updated version of cython, all major release start form 0.21 and up, you have to downgrade cython to 0.20 ( sudo pip install cython==0.20 ) then removing .buildozer folder ( rm -Rf .buildozer ) and then rebuilding with 'buildozer android debug'

Python Math.abs Code Example

Example 1: python absolute value >> > abs ( - 15 ) 15 Example 2: math abs python variableName = - 4 print ( abs ( variableName ) ) # output is 4

Button With Image Background Flutter

Answer : the "RaisedButton" is a material component , its take it shape depends on "material design" roles , you can create your own custom button widget GestureDetector( child: Container( width:120, height: 40, decoration: BoxDecoration( color: Colors.black, image: DecorationImage( image:AssetImage("assets/background_button.png"), fit:BoxFit.cover ), child: Text("clickMe") // button text ) ),onTap:(){ print("you clicked me"); } ) If anyone else come here looking for this, MaterialButton works perfectly. MaterialButton( padding: EdgeInsets.all(8.0), textColor: Colors.white, splashColor: Colors.greenAccent, elevation: 8.0, child: Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage('assets/button_colo

Converting Javascript Integer To Byte Array And Back

Answer : Using the hint provided by Susanoh13, here are the two functions that allow conversion of number from/to ByteArray: longToByteArray = function(/*long*/long) { // we want to represent the input as a 8-bytes array var byteArray = [0, 0, 0, 0, 0, 0, 0, 0]; for ( var index = 0; index < byteArray.length; index ++ ) { var byte = long & 0xff; byteArray [ index ] = byte; long = (long - byte) / 256 ; } return byteArray; }; byteArrayToLong = function(/*byte[]*/byteArray) { var value = 0; for ( var i = byteArray.length - 1; i >= 0; i--) { value = (value * 256) + byteArray[i]; } return value; }; In JavaScript bit shifts ( >> , << ) are always performed on signed, 32-bits integers. This leads to range overflow for large numbers. try ( ** is power operator, << and >>> are bit-shift operators) - intFromBytes works only for arrays generated from positive integers function getInt64By

Rotate3d Css Animation Code Example

Example: css rotate3d euler angles var angles = { x : 45 , y : 34 , z : 64 } ; var css = `rotateX ( $ { angles.x } deg ) rotateY ( $ { angles.y } deg ) rotateZ ( $ { angles.z } deg ) ` ;

Add Primary Key To PostgreSQL Table Only If It Does Not Exist

Answer : Why not include the PK definition inside the CREATE TABLE: CREATE TABLE IF NOT EXISTS mail_app_recipients ( id_draft Integer NOT NULL, id_person Integer NOT NULL, constraint pk_mail_app_recipients primary key (id_draft, id_person) ) You could do something like the following, however it is better to include it in the create table as a_horse_with_no_name suggests. if NOT exists (select constraint_name from information_schema.table_constraints where table_name = 'table_name' and constraint_type = 'PRIMARY KEY') then ALTER TABLE table_name ADD PRIMARY KEY (id); end if; You can try to DROP it before creating it ( DROP has the IF EXISTS clause): ALTER TABLE mail_app_recipients DROP CONSTRAINT IF EXISTS mail_app_recipients_pkey; ALTER TABLE mail_app_recipients ADD CONSTRAINT mail_app_recipients_pkey PRIMARY KEY ("id_draft","id_person"); Note that this require that you give a name to the primary key constraint - in th

Bootstrap4 Navbar Example

Example: bootstrap4 navbar < nav class = " navbar navbar-expand-lg navbar-light bg-light " > < a class = " navbar-brand " href = " # " > Navbar </ a > < button class = " navbar-toggler " type = " button " data-toggle = " collapse " data-target = " #navbarNav " aria-controls = " navbarNav " aria-expanded = " false " aria-label = " Toggle navigation " > < span class = " navbar-toggler-icon " > </ span > </ button > < div class = " collapse navbar-collapse " id = " navbarNav " > < ul class = " navbar-nav " > < li class = " nav-item active " > < a class = " nav-link " href = " # " > Home < span class = " sr-only " > (current) </ span > </ a > </ li > &

Android Studio Add Button Border Radius Code Example

Example: how to add corner radius in android button < shape xmlns: android = " http://schemas.android.com/apk/res/android " android: shape = " rectangle " > < solid android: color = " @color/primary " /> < corners android: radius = " 5dp " /> </ shape >

Can't See My Device Of Chrome://inspect/#devices

Answer : Try these steps: Download and install Android SDK Open SDK Manager.exe Select Android SDK Platform-tools and press Install packages... Open a command prompt and execute these commands: cd C:\Program Files(x86)\Android\android-sdk\platform-tools (or C:\Users\User\AppData\Local\Android\Sdk\platform-tools ) adb.exe devices You should receive a response like this: List of devices attached ABCDEFG123 device If your device is listed check if Chrome detect the device, otherwise try to execute this command: adb.exe kill-server adb.exe start-server adb.exe devices Check again if Chrome detect the device. If your device is not listed at all after executing adb devices command there is something wrong in your configuration (e.g. incorrect or missing drivers?) Hope this helps somebody else... This happened to me because I was trying to Chrome inspect a release build (Ionic; i.e. ionic build android --release ). If I build a debug app ( ionic build andr