Posts

Showing posts from May, 2005

Css Triangle With Borders Code Example

Example 1: triangle using css border .arrow-up { width : 0 ; height : 0 ; border-left : 5 px solid transparent ; border-right : 5 px solid transparent ; border-bottom : 5 px solid black ; } .arrow-down { width : 0 ; height : 0 ; border-left : 20 px solid transparent ; border-right : 20 px solid transparent ; border-top : 20 px solid #f00 ; } .arrow-right { width : 0 ; height : 0 ; border-top : 60 px solid transparent ; border-bottom : 60 px solid transparent ; border-left : 60 px solid green ; } .arrow-left { width : 0 ; height : 0 ; border-top : 10 px solid transparent ; border-bottom : 10 px solid transparent ; border-right : 10 px solid blue ; } Example 2: how to make a triangle in css .triangle { border-left : 5 px solid transparent ; border-right : 5 px solid transparent ; border-bottom : 5 px solid red ; border-width : 100 px ; }

How To Put Code In Comments Shortcut Visual Studio Code Example

Example: shortcut comment visual studio Comment Code Block Ctrl + K + C / Ctrl + K + U If you select a block of code and use the key sequence Ctrl + K + C , you 'll comment out the section of code . Ctrl + K + U will uncomment the code .

Css Id Vs Class Code Example

Example 1: difference between id and class in css /* The difference between an ID and a class is that an ID is only used to identify one single element in our HTML. IDs are only used when one element on the page should have a particular style applied to it. However, a class can be used to identify more than one HTML element. */ Example 2: css id vs class In CSS , => Differences ID : - Each element can have only one ID - Each page can have only one element with that ID Class : - You can use the same class on multiple elements. - You can use multiple classes on the same element. => When to use ID : Use id for single-use elements Class : Use classes for multi-use elements => Naming convention - BEM 101 : https : //css-tricks.com/bem-101/ - Basic : Lower case and hyphenate multiwords. Ids have to be unique and distingu ishable and classes should be named after what they represent and not what their styling does. Example 3: css class id css .class #id

Can I Profile NodeJS Applications Using Visual Studio Code?

Image
Answer : There is no plugin/support that I am aware of for initiating the profiling, or heap dumps, etc that are available in Chrome's Dev Tools. But, the VS Code debugger can work alongside the dev tools debugger. Start from VS Code, and start debugging as you would. Then open dev tools from any tab in the Chrome/Chromium browser, and look for the green icon indicating a node.js debugging process is running ( manually done via node --inspect ): . Click this green icon and you'll have many of the browser dev tools features for debugging the node.js process, specifically the memory and profiler tabs. Visual Studio Code 1.45 (April 2020) should help, as it integrates Javascript debugging capabilities, including profiling: New JavaScript debugger This month we've continued making progress on our new JavaScript debugger. It's installed by default on Insiders, and can be installed from the Marketplace in VS Code Stable. You can start using it with your e

Android Apk Metasploit Windows Code Example

Example: download metasploit curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \ chmod 755 msfinstall && \ ./msfinstall

Brython Tutorial Code Example

Example 1: python tutorial print ( "Hello, Python!" ) ; Example 2: python tutorial This is a very good free python tutorial : https : / / www . youtube . com / watch ? v = _uQrJ0TkZlc Example 3: python tutorial # printing hello world in python print ( "Hello World" ) # adding 2 numbers num1 = 10 num2 = 20 print ( num1 + num2 )

Interface Constructor Typescript Code Example

Example 1: typescript class implements interface interface Task { name : String ; //property run ( arg : any ) : void ; //method } class MyTask implements Task { name : String ; constructor ( name: String ) { this.name = name ; } run ( arg: any ) : void { console .log ( `running: $ { this.name } , arg: $ { arg } ` ) ; } } let myTask : Task = new MyTask ( 'someTask' ) ; myTask. run ( "test" ) ; Example 2: typescript interface interface NumberOrStringDictionary { [ index : string] : number | string ; length : number ; // ok , length is a number name : string ; // ok , name is a string } Try

Angular 4 CLI Too Slow After Ng Serve And When Updating

Answer : i solved my problem. What happened is that our components and other resources are all imported in app.module.ts . Because of this, the page loads all the resources every time the page loads. My solution was to apply Lazy Loading to load only those resources that are specific to the routes that i am accessing and it did fix up the loading issue. You have this problem is because your dev PC have not enough memory to handle the build as nodejs is consuming a lot of memory when you run expensive npm tasks. And the bigger your project the more memory is required to complete the task. The problem can get even worse if you want to run ng serve + ng t + ng whatewer at the same time. Check the Task manager -> Perfomrmance tab then run ng serve and you will see what I am talking about. I had struggled by the same problem until I put another 8gb RAM in my dev PC. So yes it is normal.

Convert ASCII Character To X11 Keycode

Answer : This question has an old, wrong answer (from @oldrinb), that oddly has never been challenged. As stated in the comment, you can't use XStringToKeysym to map chars to KeySyms in a general way. It will work for letters and numbers, but that's about it, because the KeySym name happens to map directly for those ASCII characters. For other ASCII characters such as punctuation or space it won't work. But you can do better than that. If you look at <X11/keysymdef.h> you find that for ASCII 0x20-0xFF, the characters map directly to XKeySyms . So, I'd say it's simpler to just use that range of characters directly as KeySyms , and just map the remaining 32 characters to their corresponding KeyCodes . So I'd say the code should more properly be: Display *display = ...; if ((int)c >= 0x20) { XKeysymToKeycode(display, (KeySym)c); } else { ... // Exercise left to the reader :-) } The 'else' clause will require multiple KeyCodes since f

How To Link Css File To Html In Visual Studio Code Code Example

Example: how to link css to html in visual studio code > <!DOCTYPE html> > > <header> > <meta charset= "UTF-8" > > <title>Homepage.html</title> > <link rel= "stylesheet" type= "text/css" href= "./style.css" /> > </header> > <body> > </body> > </html>

Android Studio With Java Compiler Error: String Too Large To Encode Using UTF-8 Written Instead As 'STRING_TOO_LARGE'

Answer : I had encountered the same and fixed by clear the build cache . For the time being, you can downgrade Gradle version to resolve this issue. Use gradle 3.1 version like 3.1.3 below. classpath 'com.android.tools.build:gradle:3.1.3' I was stuck on this problem and read through this topic and no one provided a future solution. I did NOT want to revert back my Gradle. Therefore, here is the link to the updated dependencies https://github.com/stripe/stripe-android. Look for the "Android Studio (or Gradle)" section and you should see this "implementation 'com.stripe:stripe-android:8.1.0'" also you might need to add "-keep class com.stripe.android.** { *; }" if you are enabling minification in your build.gradle file. Overall Stripe has stopped updating their own "Stripe docs" which can be found here. To give them credit their docs are helpful and should be read at least once, but be mindful that most of the docs are

Balanced Parentheses Hackerrank Solution Java Code Example

Example: balanced brackets hackerrank solution in cpp # include <iostream> # include <algorithm> # include <unordered_map> # include <stack> using namespace std ; string isBalanced ( string s ) { stack < char > st ; for ( auto c : s ) { switch ( c ) { case '(' : case '{' : case '[' : st . push ( c ) ; break ; case '}' : if ( st . empty ( ) || st . top ( ) != '{' ) return "NO" ; st . pop ( ) ; break ; case ']' : if ( st . empty ( ) || st . top ( ) != '[' ) return "NO" ; st . pop ( ) ; break ; case ')' : if ( st . empty ( ) || st . top ( ) != '(

Connecting To Gmail IMAP PHP "Couldn't Open Stream"

Answer : You need port 993 , the SSL IMAP port. Port 995 is the SSL POP3 port. I think Gmail's IMAP can only be accessed on port 993. $hostname = "{imap.gmail.com:993/imap/ssl/novalidate-cert}"; I had the same error and found a different solution. I have added debug info into host: "{imap.gmail.com:993/debug/imap/ssl/novalidate-cert}INBOX"; When I read php error log, I found Unknown: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure) (errflg=1) in Unknown on line 0 Open link, and follow instructions. Search for Your app might not support the latest security standards. Try changing a few settings to allow less secure apps access to your account. Click on link and enable less secure app access. Then it works for me.

Add Password To Existing Zip File With 7zip

Answer : By nature if you want the file to be encrypted, it needs to be unpacked and repacked, since the whole archive needs to be encrypted with the password. Would it work for you to zip the zip file? Use no/low compression and encrypt the original zip file. Its a lot quicker than repacking the original files.

Random Video Chat App Code Example

Example: omegle Site with pedophiles

Css Transition-delay Example

The transition-delay CSS property specifies the duration to wait before starting a property's transition effect when its value changes. The delay may be zero, positive, or negative: A value of 0s (or 0ms ) will begin the transition effect immediately. A positive value will delay the start of the transition effect for the given length of time. A negative value will begin the transition effect immediately, and partway through the effect. In other words, the effect will be animated as if it had already been running for the given length of time. You may specify multiple delays, which is useful when transitioning multiple properties. Each delay will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. If there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. If there are more delays, the list of delay values will be truncated to match the

C++ Extract Substring Code Example

Example 1: std::substring // string : : substr #include <iostream> #include <string> int main ( ) { std : : string str = "We think in generalities, but we live in details." ; // ( quoting Alfred N . Whitehead ) std : : string str2 = str . substr ( 3 , 5 ) ; // "think" std : : size_t pos = str . find ( "live" ) ; // position of "live" in str std : : string str3 = str . substr ( pos ) ; // get from "live" to the end std : : cout << str2 << ' ' << str3 << '\n' ; return 0 ; } Example 2: string substr c++ s . substr ( pos , len ) ;

Swal Npm Code Example

Example 1: sweetalert angular 8 npm install --save sweetalert2 Example 2: sweetalert2 <script src= "https://cdn.jsdelivr.net/npm/sweetalert2@9" ></script> Example 3: sweetalert2 js <link href= "//cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css" rel= "stylesheet" > <script src= "//cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.js" ></script>

Align DataGrid Column Header To Center

Answer : Check this <DataGridTextColumn Header="Nombre" Binding="{Binding Nombre}"> <DataGridTextColumn.HeaderStyle> <Style TargetType="DataGridColumnHeader"> <Setter Property="HorizontalContentAlignment" Value="Center" /> </Style> </DataGridTextColumn.HeaderStyle> It should be StaticResource instead of DynamicResource in the Column: Style <Window.Resources> <Style x:Key="CenterGridHeaderStyle" TargetType="DataGridColumnHeader"> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </Window.Resources> Column <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" IsReadOnly="True" HeaderStyle="{StaticResource CenterGridHeaderStyle}"/> There is a response for doing it progr

How To Use Otf Fonts In Css Code Example

Example: otf css3 font-face @font-face { font-family : GraublauWeb ; src : url ( "path/GraublauWeb.otf" ) format ( "opentype" ) ; }

Convert Javascript To Python Online Code Example

Example: convert js to python online >>> import js2py >>> f = js2py . eval_js ( 'function f(x) {return x + x}' ) >>> f ( 2 ) 4 >>> f ( ) nan >>> f ( f ) function f ( x ) { [ python code ] } function f ( x ) { [ python code ] }

Position Css Center Code Example

Example 1: css align center //HTML <div class="parent" > <span > Hello World</span > </div > //CSS .parent { display : flex ; justify-content : center ; align-items : center ; } Example 2: css align items vertical center .parent { display : flex ; justify-content : center ; align-items : center ; } Example 3: css center /* this will center all children within the parent element. */ .parent { display : flex ; justify-content : center ; /* horizontal */ align-items : center ; /* vertical */ } Example 4: center css div .container4 { height : 10 em ; position : relative } div .container4 p { margin : 0 ; background : yellow ; position : absolute ; top : 50 % ; left : 50 % ; margin-right : -50 % ; transform : translate ( -50 % , -50 % ) } Example 5: center text in div container text-align : center Example 6: align center css margin : auto ;

Crontab's @reboot Only Works For Root?

Answer : This can be a bit of a confusing topic because there are different implementations of cron. Also there were several bugs that broke this feature, and there are also some use cases where it simply won't work, specifically if you do a shutdown/boot vs. a reboot. Bugs datapoint #1 One such bug in Debian is covered here, titled: cron: @reboot jobs are not run. This seems to have made it's way into Ubuntu as well, which I can't confirm directly. datapoint #2 Evidence of the bug in Ubuntu would seem to be confirmed here in this SO Q&A titled: @reboot cronjob not executing. excerpt comment #1: .... 3) your version of crond may not support @reboot are you using vix's crond? ... show results of crontab -l -u user comment #2: ... It might be a good idea to set it up as an init script instead of relying on a specific version of cron's @reboot. comment #3: ... @MarkRoberts removed the reboot and modified the 1 * * * * , to */1 * * * * , problem is solv