What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-14 10:16:03
How to avoid scientific notation for large numbers in JavaScript?
function toFixed(x) { if (Math.abs(x) < 1.0) { var e = parseInt(x.toString().split('e-')[1]); if (e) { x *= Math.pow(10,e-1); x = '0.' + (new Array(e)).join('0') + x.toString().substring(2); } } else { var e = parseI... Add solution -
TypeScript 2021-09-14 08:51:01
typescript parameter function type
class Foo { save(callback: (n: number) => any) : void { callback(42); } } var foo = new Foo(); var strCallback = (result: string) : void => { alert(result); } var numCallback = (result: number) : void => { alert(result.to... Add solution -
Javascript 2021-09-14 08:09:06
vue test utils mapgetter
import { shallowMount, createLocalVue } from '@vue/test-utils' import Vuex from 'vuex' import MyComponent from '../../../src/components/MyComponent' import myModule from '../../../src/store/myModule' const localVue = createLocalVue() localVue.use(Vuex) ... Add solution -
Java 2021-09-14 04:09:02
android java mediacontroller example
private void play() { mProgressBar.setVisibility(View.VISIBLE); Uri videoUri = Uri.parse(mVideoUrl); try { mVideoView.setOnCompletionListener(this); mVideoView.setOnPreparedListener(this); mVideoView.setOnErrorListener(this); mVideoView.setVide... Add solution -
Other 2021-09-14 01:22:03
insert * if subsequent number even - if odd
public class InsertStarBetweenEvenAndDashBetweenOdd { public static void main(String[] args) { long l=104875l; String s= ""+l; StringBuilder s2= new StringBuilder(""); s2.append(s.charAt(0)); for(int i=1;i<s.leng... Add solution