Posts

Converting A VMDK To VHD

Answer : The Microsoft Virtual Machine Converter (MVMC) includes the Microsoft Virtual Disk Converter tool (MVDC.exe) that converts a VMDK file to a VHD file. http://www.microsoft.com/en-ca/download/details.aspx?id=42497 MVDC SrcDisk DstDisk [/?] [/Dyn] SrcDisk Specifies the source VMDK disk path to be converted. DstDisk Specifies the path for the converted disk. [/?] Show Help [/Dyn] Indicates the destination disk should be dynamic rather than fixed. For example: C:\Program Files (x86)\Microsoft Virtual Machine Converter Solution Accelerator>mvdc "D:\VM\Windows Server 2008 R2 x64\Windows Server 2008 R2 x64.vmdk" "D:\VM\Windows Server 2008 R2 x64\Windows Server 2008 R2 x64.vhd" Step 1 of 3: Loading Source Disk... Step 1 of 3: Loading Source Disk Completed. Source file found of size 40.0 GB. DiskGeometry: Cylinders: 5221 Tracks/Cylinder: 255 Sectors/Track: 63 Bytes/Sector: 512 MediaType: FixedMedia Step 2 of 3: Cr...

Css Transform Animation Code Example

Example 1: css transition opacity /* Answer to: "css transition opacity" */ /* CSS transitions allows you to change property values smoothly, over a given duration. */ .myClass { vertical-align: top; transition: opacity 0.3s; /* Transition should take 0.3s */ -webkit-transition: opacity 0.3s; /* Transition should take 0.3s */ opacity: 1; /* Set opacity to 1 */ } .myClass:hover { opacity: 0.5; /* On hover, set opacity to 2 */ } /* From `opacity: 1;` to `opacity: 0.5;`, the transition time should take 0.3 seconds as soon as the client starts to hover over the element. */ Example 2: transition transform /* Transition Transform */ .section:hover { transform: translateX(0px) translateY(75px); } .section { transition: transform 500ms ease-in-out 25ms; } Example 3: css transform transform: matrix(1, 2, 3, 4, 5, 6); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: translate(120px, 50%); transform: scale(2, 0.5); transform: rot...

Bulma Icon Not Showing Up?

Answer : You also need to include the bulma.min.css file, not just the .map . Edit Per the Bulma docs: If you want to use icons with Bulma, don't forget to include Font Awesome: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> Update 3/19/2019 As @Akshay has pointed out below, the documentation has changed and the proper way to include Font Awesome is now <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>

Latex \footnotesize Code Example

Example 1: latex font sizes \Huge \huge \LARGE \Large \large \ normalsize ( default ) \small \footnotesize \scriptsize \tiny Example 2: latex font sizes Change global font size : \documentclass [ 12 pt ] { report }

Compiled Vs. Interpreted Languages

Answer : A compiled language is one where the program, once compiled, is expressed in the instructions of the target machine. For example, an addition "+" operation in your source code could be translated directly to the "ADD" instruction in machine code. An interpreted language is one where the instructions are not directly executed by the target machine, but instead read and executed by some other program (which normally is written in the language of the native machine). For example, the same "+" operation would be recognised by the interpreter at run time, which would then call its own "add(a,b)" function with the appropriate arguments, which would then execute the machine code "ADD" instruction. You can do anything that you can do in an interpreted language in a compiled language and vice-versa - they are both Turing complete. Both however have advantages and disadvantages for implementation and use. I'm going to completely ...

Mattoolbarmodule Angular 10 Code Example

Example: mat-toolbar <mat-toolbar-row> <span>Second Line</span> <span class= "example-spacer" ></span> <mat-icon class= "example-icon" aria-hidden= "false" aria-label= "Example user verified icon" >verified_user</mat-icon> </mat-toolbar-row>

C++ Sizeof Char Array Code Example

Example: how to find the size of a character array in c++ Instead of sizeof ( ) for finding the length of strings or character arrays , just use strlen ( string_name ) with the header file # include <cstring> it's easier .

Converting String To Cstring In C++

Answer : .c_str() returns a const char* . If you need a mutable version, you will need to produce a copy yourself. vector<char> toVector( const std::string& s ) { string s = "apple"; vector<char> v(s.size()+1); memcpy( &v.front(), s.c_str(), s.size() + 1 ); return v; } vector<char> v = toVector(std::string("apple")); // what you were looking for (mutable) char* c = v.data(); .c_str() works for immutable. The vector will manage the memory for you.

Adding A Linestring By St_read In Shiny/Leaflet

Answer : Your test data is a dead link now, but I had a similar issue trying to plot sf linestrings and polygons in leaflet . The full error was Error in if (length(nms) != n || any(nms == "")) stop("'options' must be a fully named list, or have no names (NULL)") : missing value where TRUE/FALSE needed I was able to successfully plot my geometries by dropping the Z dimension from the line and polygon with st_zm . Here is an example: library(sf) library(leaflet) # create sf linestring with XYZM dimensions badLine <- st_sfc(st_linestring(matrix(1:32, 8)), st_linestring(matrix(1:8, 2))) # check metadata for badLine > head(badLine) Geometry set for 2 features geometry type: LINESTRING dimension: XYZM bbox: xmin: 1 ymin: 3 xmax: 8 ymax: 16 epsg (SRID): NA proj4string: NA LINESTRING ZM (1 9 17 25, 2 10 18 26, 3 11 19 2... LINESTRING ZM (1 3 5 7, 2 4 6 8) # attempt map; will fail > leaflet(...

A Windows Equivalent Of The Unix Tail Command

Answer : If you use PowerShell then this works: Get-Content filenamehere -Wait -Tail 30 Posting Stefan's comment from below, so people don't miss it PowerShell 3 introduces a -Tail parameter to include only the last x lines I'd suggest installing something like GNU Utilities for Win32. It has most favourites, including tail. I've always used Baretail for tailing in Windows. It's free and pretty nice. Edit: for a better description of Baretail see this question

Char Count Online Code Example

Example 1: count letters numbers and characters public static String countLetter ( String str ) { String abc = str ; int a = 0 , b = 0 ; while ( str . length ( ) > 0 ) { int i = 0 ; String ch = str . substring ( i , i + 1 ) ; if ( ch . matches ( ".*[a-zA-Z].*" ) ) { a ++ ; } else if ( ch . matches ( ".*[0-9].*" ) ) { b ++ ; } str = str . substring ( i + 1 ) ; } return abc + " has " + a + " letters " + b + " digit and "+(abc.length()-(a+b))+" other characters " ; OR ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + static void findSum ( String str ) { int total = str . length ( ) ; str = str . replaceAll ( "\\s" , "" ) ; int num = 0 ; int letter = 0 ; int i = 0 ; while ( i < str . length ( ) ) { char ch = str . charAt ( i ) ...

Get File Size Of File In Windows C Code Example

Example 1: how to check the size of a file c If you have the file stream ( FILE * f ) : fseek ( f , 0 , SEEK_END ) ; // seek to end of file size = ftell ( f ) ; // get current file pointer fseek ( f , 0 , SEEK_SET ) ; // seek back to beginning of file // proceed with allocating memory and reading the file Or , # include <sys/types.h> # include <sys/stat.h> # include <unistd.h> fd = fileno ( f ) ; struct stat buf ; fstat ( fd , & buf ) ; int size = buf . st_size ; Or , use stat , if you know the filename : # include <sys/stat.h> struct stat st ; stat ( filename , & st ) ; size = st . st_size ; Example 2: size of file in c // C program to find the size of file # include <stdio.h> long int findSize ( char file_name [ ] ) { // opening the file in read mode FILE * fp = fopen ( file_name , "r" ) ; // checking if the file exist or not if ( fp == NULL ) { p...

Create Cylinder Shape In Pure Css 3d

Answer : there are some advanced examples like these: http://x.dtott.com/3d/ http://cssdeck.com/labs/pure-css-3d-primitives and some useful CSS shapes like these: http://css-tricks.com/examples/ShapesOfCSS/ personally I built this simple one HTML <div class="tank"> <div class="bottom"></div> <div class="middle"></div> <div class="top"></div> </div> and CSS .tank{ position:relative; margin:50px; } .tank .middle{ width:120px; height:180px; background-color:#444; position:absolute; } .tank .top{ width: 120px; height: 50px; background-color:#666; -moz-border-radius: 60px / 25px; -webkit-border-radius: 60px / 25px; border-radius: 60px / 25px; position:absolute; top:-25px; } .tank .bottom{ width: 120px; height: 50px; background-color:#444; -moz-border-radius: 60px / 25px; -webkit-border-radius: 60px / 25px; bo...

A Motor Boat Whose Speed In Still Water Is 15 Km H Goes 30 Km Downstream And Comes Back In A Total 4 Hrs 30 Mins. Determine The Speed Of The Stream. Code Example

Example: A boat covers a certain distance downstream in 1 hour, while it comes back in 1 hour 40 min. If the speed of the stream be 5 kmph, what is the speed of the boat in still water? A boat covers a certain distance downstream in 1 hour, while it comes back in 1 hour 40 min. If the speed of the stream be 5 kmph, what is the speed of the boat in still water?

Odd Child Css Code Example

Example 1: css odd even child tr :nth-child ( even ) { background : #CCC } tr :nth-child ( odd ) { background : #FFF } Example 2: nth-child() css /* Selects the second <li> element in a list */ li :nth-child ( 2 ) { color : lime ; } /* Selects every fourth element among any group of siblings */ :nth-child ( 4n ) { color : lime ; } Example 3: css nth child :nth-child ( 3 ) { //the number is the child number you are targeting //styles here } Example 4: select even child css li :nth-child ( even ) { /* Selects only even elements */ color : green ; } Example 5: select odd child css li :nth-child ( odd ) { /* Selects only odd elements */ color : green ; }

Android: How To Determine Network Speed In Android Programmatically

Answer : Determining your Network Speed - (Slow Internet Speed) Using NetworkInfo class, ConnectivityManager and TelephonyManager to determine your Network Type. Download any file from the internet & calculate how long it took vs number of bytes in the file. ( Only possible way to determine Speed Check ) I have tried the below Logic for my projects, You have also look into this, Hope it helps you. ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); //should check null because in airplane mode it will be null NetworkCapabilities nc = cm.getNetworkCapabilities(cm.getActiveNetwork()); int downSpeed = nc.getLinkDownstreamBandwidthKbps(); int upSpeed = nc.getLinkUpstreamBandwidthKbps(); Check internet speed for mobile network to use this code ConnectivityManager connectivityManager = (ConnectivityManager)this.getSystemService(CONNECTIVITY_SERVICE); Ne...