Posts

Showing posts from May, 2016

How To Print Bool Variable In C Code Example

Example: how to print boolean in c printf ( "%s" , x ? "true" : "false" ) ;

CSS Double Border (2 Colors) Without Using Outline?

Answer : You can add multiple borders using pseudo elements, and then place them around your original border. No extra markup. Cross-browser compatible, this has been around since CSS 2.1. I threw a demo up on jsfiddle for you....note, the spacing between border colors is there for the example. You can close it by altering the number of pixels in the absolute positioning. .border { border:2px solid #36F; position:relative; z-index:10 } .border:before { content:""; display:block; position:absolute; z-index:-1; top:2px; left:2px; right:2px; bottom:2px; border:2px solid #36F } http://jsfiddle.net/fvHJq/1/ Use box shadow fo 2nd border. div.double-border { border: 1px solid #fff; -webkit-box-shadow: 0px 0px 0px 1px #000; -moz-box-shadow: 0px 0px 0px 1px #000; box-shadow: 0px 0px 0px 1px #000; } In this case box-shadow does not ignore border-radius property like outline does A very simple solution you could use as

Android Studio - Google Map Still Blank On Real Android Device On Release Apk

Image
Answer : Make sure you enter your release API key in the google_maps_api.xml under the release folder. First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/ , and you will see subfolders debug and release . Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values . Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk. i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate , and the map works after i copy that sha1 and paste it in the google console for the android map. Go to https://play.google.com/apps/publish/ and then to App signing : Maybe you will see this: If that is the case, maybe you are a developer and not the account owner. You will have to contact the ac

Bootstrap Overflow Horizontal Scroll Code Example

Example 1: make a container scrollable bootstrap .anyClass { height:150px; overflow-y: scroll; } Example 2: overflow hidden in bs4 < div class = " overflow-auto " > ... </ div > < div class = " overflow-hidden " > ... </ div >

Count Rows SQL Code Example

Example 1: sql query to get the number of rows in a table SELECT COUNT ( * ) FROM tablename Example 2: sql count /*COUNT(column_name) will return the number of rows from the column that are not NULL*/ SELECT COUNT ( column_name ) FROM table_name ; /*COUNT(*) will return the number of rows from the table*/ SELECT COUNT ( * ) FROM table_name ; Example 3: To count number of rows in SQL table SELECT count ( * ) FROM information_schema . columns WHERE table_name = 'Your_table_nale' ; Example 4: how to count number of rows in sql SELECT COUNT ( * ) FROM dbo . bigTransactionHistory ;

Perspective Css Property Code Example

Example: css perspective .parent { perspective : 100 px ; }

Sizeof 2d Vector Code Example

Example 1: how to get size of 2d vector in c++ myVector [ Vector [ 0 , 4 , 2 , 5 ] , Vector [ 1 , 4 , 2 ] ] ; /*When you call for myVector[1].size() it would return 3 and [0] would return 4. For the amount of rows (int vectors) in the 2d vector, you can just use myVector.size() You can run this to see it in actions*/ Example 2: size of a matrix using vector c++ // finding size of a square matrix myVector [ 0 ] . size ( ) ;

Convert Float To String In Php?

Answer : echo number_format($float,0,'.',''); note: this is for integers, increase 0 for extra fractional digits $float = 0.123; $string = sprintf("%.3f", $float); // $string = "0.123"; It turns out json_decode by default casts large integers as floats. This option can be overwritten in the function call: $json_array = json_decode($json_string, , , 1); I'm basing this only on the main documentation, so please test and let me know if it works.

Enable Or Disable Gameobject Unity Code Example

Example 1: unity c# set gameobject active gameObject . SetActive ( true ) Example 2: unity enable gameobject GameObject . Find ( "PlayMenu 3" ) . SetActive ( false ) ; // you could also store a GameObject as variable Example 3: how to disable a gameObject unity c# public GameObject gameObj ; //the gameobject you want to disable in the scene gameObj . SetActive ( true ) ; //set the object to active gameObj . SetActive ( false ) ; //set the object to disable gameObject . SetActive ( true ) ; //change the state of the current gameobject to active gameObject . SetActive ( false ) ; //change the state of the current gameobject to disable Example 4: how to deactivate an object unity Object . SetActive ( true / false ) ;

Android Deep Links Not Following Path Prefix

Answer : I figured it out, It seems like the data tags sort of bleed into one another, so the prefix of "/" on the data with scheme "example" was also applying to all of the schemes in the other data tags. I just had to use separate Intent filters for my custom scheme deep links and the url deep links like so: <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <!-- must start with http://test.example.com/app --> <!-- http://test.example.com/ won't work since prefix / is in a different intent-filter --> <data android:scheme="http" android:host="test.example.com" android:pathPrefix="/app"/>

1x1 World Record Rubik's Cube Code Example

Example: 1x1 rubik's cube world record 8 minuites and 59 seconds

Convertisseur Youtube Mp4 Code Example

Example 1: youtube to mp4 ytmp3 . cc is the best by far Example 2: youtube to mp4 flvto . biz is great for it

How To Make A Button Active By Default Code Example

Example: how to make a button active by default <div id="myDIV" > <button class="btn" > 1</button > <button class="btn active" > 2</button > <button class="btn" > 3</button > <button class="btn" > 4</button > <button class="btn" > 5</button > </div > style :- .btn { border : none ; outline : none ; padding : 10 px 16 px ; background-color : #f1f1f1 ; cursor : pointer ; } /* Style the active class (and buttons on mouse-over) */ .active , .btn :hover { background-color : #666 ; color : white ; }

Add Specific Page Of Visio Diagram Into Word Document

Answer : I suspect that you are inserting the link by going to Word's Insert tab, Text group, then clicking the Object dropdown and selecting Object. If you go that route, Word does not offer any of the internal objects in the Visio file. If so, you may find it easier to start with the Visio file open in Visio (one reason is that you don't have to remember the names of all the pages/objects), then Select the tab of the page that you want to link to Click Copy In Word's Home tab, Click the arrow at the bottom of the Paste button Click Paste Special... Click the Paste Link radio button Click the format you want (e.g. Microsoft Visio Drawing object) Click OK Incidentally, (a) you can link to things other than complete pages such as individual shapes and grouped shapes using this technique (or the one described by Johnny Estilles, as long as you know the correct name to use for the shape). (b) I think in Visio you will always get the first page in the close

Android - Adb Push ... Permission Denied

Answer : Edit: I found a work-around: AirDroid allows me to upload the file, but the permissions on the file are set to this: -rw------- Performing the following commands solves this problem (from Windows 7 command prompt). >adb shell # su # chmod 777 /data/data/com.me.app/databases/data.db The usual approach, which doesn't require any additional apps: Push to /data/tmp/ ; Copy on the device using adb shell , using cp if it's available on your device or cat if it isn't. > adb push data.db /data/tmp/data.db > adb shell # su # or run-as com.me.app # cp /data/tmp/data.db /data/data/com.me.app/databases/data.db Remembering to change com.me.app to the correct package name for your app.

Conda Environment Has No Name Visible In Conda Env List - How Do I Activate It At The Shell?

Answer : Name-based reference of Conda environments only works for environments located in one of the directories listed in the envs_dirs configuration option (see conda config --describe envs_dirs ). By default this corresponds to the envs/ subdirectory in the Conda installation. If you create an env outside of one of these directories, then you cannot use a name to reference it. Option 1: Clone Into Directory One option to use conda activate B3 , is to recreate your B3 env in the default directory. You can use the --clone flag to accomplish this. conda create --clone path/to/the/nameless_env -n named_env Option 2: Add Parent Directory Alternatively, you can add the parent directory of the environment in question to the envs_dirs configuration option. conda config --append envs_dirs /path/to/the/parent_dir Option 3: Symbolic Link Another possibility is to create a symbolic link in one to the envs_dirs folders to the environment folder. It seems to work, but it is not a commo

Convert Millisecond To Second Javascript Code Example

Example: convert milliseconds to minutes and seconds javascript const millisToMinutesAndSeconds = ( millis ) => { var minutes = Math . floor ( millis / 60000 ) ; var seconds = ( ( millis % 60000 ) / 1000 ) . toFixed ( 0 ) ; //ES6 interpolated literals/template literals //If seconds is less than 10 put a zero in front. return ` ${ minutes } : ${ ( seconds < 10 ? "0" : "" ) } ${ seconds } ` ; }

Vscode Compiler Path C++ Code Example

Example 1: how to run cpp using gcc vscode { "version" : "0.1.0" , "command" : "make" , "isShellCommand" : true , "tasks" : [ { "taskName" : "Makefile" , // Make this the default build command. "isBuildCommand" : true , // Show the output window only if unrecognized errors occur. "showOutput" : "always" , // Pass 'all' as the build target "args" : [ "all" ] , // Use the standard less compilation problem matcher. "problemMatcher" : { "owner" : "cpp" , "fileLocation" : [ "relative" , "${workspaceRoot}" ] , "pattern" : { "regexp" : "^

Stl Stack Code Example

Example 1: stack c++ stack < int > stk ; stk . push ( 5 ) ; int ans = stk . top ( 5 ) ; // ans =5 stk . pop ( ) ; //removes 5 Example 2: stack stl # include <iostream> # include <stack> # include <algorithm> using namespace std ; int main ( ) { stack < int > st ; stack < int > st1 ; st . push ( 100 ) ; st . push ( 90 ) ; st . push ( 80 ) ; st . push ( 70 ) ; st . pop ( ) ; st1 . push ( 10 ) ; st1 . push ( 20 ) ; st1 . push ( 30 ) ; while ( ! st . empty ( ) ) { cout << st . top ( ) << " " ; st . pop ( ) ; } cout << endl ; while ( ! st1 . empty ( ) ) { cout << st1 . top ( ) << " " ; st1 . pop ( ) ; } cout << endl ; st . push ( 100 ) ; st . push ( 90 ) ; st . push ( 80 ) ; st . push ( 70 ) ; st . pop ( ) ; st1 . push ( 10

Html Textarea Placeholder Attribute Code Example

Example: textarea placeholder <!-- Make sure that there is No space and No breaklines between the <textarea></textarea>. Example below : --> <textarea placeholder= "Enter Details..." ></textarea>

Converting Hex To Decimal In Awk Or Sed

Answer : Here's a variation on Jonathan's answer: awk $([[ $(awk --version) = GNU* ]] && echo --non-decimal-data) -F, ' BEGIN {OFS = FS} { $6 = sprintf("%d", "0x" substr($4, 11, 4)) $5 = sprintf("%d", "0x" substr($4, 7, 4)) $4 = substr($4, 1, 6) print }' I included a rather contorted way of adding the --non-decimal-data option if it's needed. Edit Just for the heck of it, here's the pure-Bash equivalent: saveIFS=$IFS IFS=, while read -r -a line do printf '%s,%s,%d,%d\n' "${line[*]:0:3}" "${line[3]:0:6}" "0x${line[3]:6:4}" "0x${line[3]:10:4}" done IFS=$saveIFS The "${line[*]:0:3}" (quoted * ) works similarly to AWK's OFS in that it causes Bash's IFS (here a comma) to be inserted between array elements on output. We can take further advantage of that feature by inserting array elements as follows

Confirming Unload/Navigation In Salesforce Lightning

Answer : They actually released a component for this fairly recently: https://developer.salesforce.com/docs/component-library/bundle/lightning:unsavedChanges/documentation