This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <math.h> | |
using namespace std; | |
int main() | |
{ | |
int n, counter; | |
double penampungNilaiF[n], ek[n]; | |
double f0 = 5000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
char pilihan, ulangi; | |
int i,n=1; | |
// diketahui | |
double kb = 0.52, kf = 1.86, nTerlarut = 0.1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterFunction = (list, options) => { | |
switch (options.option) { | |
case 'age': | |
return filerByAgeRange(list, options.payload); | |
case 'name': | |
return filerByNames(list, options.payload); | |
case 'location': | |
return filterByLocation(list, options.payload); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
TextField, | |
Autocomplete, | |
AutocompleteProps, | |
UseAutocompleteProps, | |
} from "@mui/material"; | |
import React, { memo } from "react"; | |
import { Control, Controller, Path } from "react-hook-form"; | |
type UseAutoCompleteNarrowed<T> = UseAutocompleteProps< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { memo } from "react"; | |
import { TextFieldProps, TextField, MenuItem } from "@mui/material"; | |
import { Path, Control, Controller } from "react-hook-form"; | |
export type HookFormSelectProps<TFormValues> = { | |
name: Path<TFormValues>; | |
control: Control<TFormValues, any>; | |
children: React.ReactNode; | |
} & TextFieldProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"root": true, | |
// Javascript eslint configuration | |
"extends": [ | |
"airbnb", | |
"airbnb/hooks", | |
"next", | |
"next/core-web-vitals", | |
"prettier" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { z } from "zod" | |
const schema = z.object({ | |
file: | |
typeof window === "undefined" // this is required if your app rendered in server side, otherwise just remove the ternary condition | |
? z.undefined() | |
: z | |
.instanceof(FileList) | |
.refine(file => file.length !== 0, { | |
message: "File is required", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { zodResolver } from "@hookform/resolvers/zod"; | |
import { useMemo } from "react"; | |
import { useForm } from "react-hook-form"; | |
import { z } from "zod"; | |
const getFileUrl = (file?: File) => | |
file ? window.URL.createObjectURL(file) : ""; | |
const FilePage = () => { | |
const schema = z.object({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const randomizeArray = <T>(arr: T[]): T => { | |
for (let i = arr.length - 1; i > 0; i--) { | |
let j = Math.floor(Math.random() * (i + 1)); | |
[arr[i], arr[j]] = [arr[j], arr[i]]; | |
} | |
return arr[0]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dimensions } from 'react-native'; | |
const { width, height } = Dimensions.get('window'); | |
const guidelineBaseWidth = 360; | |
const guidelineBaseHeight = 724; | |
/** | |
* | |
* @param size number |
OlderNewer