This file contains hidden or 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
| var body: some View { | |
| VStack { | |
| Text(self.isAnimating ? "Spining\n..." : sectorFromAngle(angle : newAngle)) | |
| .multilineTextAlignment(.center) | |
| Image("Arrow") | |
| .resizable() | |
| .scaledToFit() | |
| .frame(width: 25, height: 25, alignment: .center) | |
| Image("roulette") | |
| .resizable() |
This file contains hidden or 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
| class Car { | |
| var wheels: Int = 0 | |
| init(wheels: Int) { | |
| self.wheels = wheels | |
| } | |
| } | |
| let myCar = Car(wheels: 4) | |
| print(CFGetRetainCount(myCar)) |
This file contains hidden or 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
| class Car { | |
| var wheel: Int = 0 | |
| init(wheels: Int) { | |
| self.wheel = wheels | |
| } | |
| } | |
| let myCar = Car(wheels: 4) | |
| print(CFGetAllocator(myCar)) |
This file contains hidden or 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
| def train_random_forest(): | |
| le = preprocessing.LabelEncoder() | |
| le.fit(dataset['Cause']) | |
| dataset['Cause'] = le.transform(dataset['Cause']) | |
| le.fit(dataset['Severity']) | |
| dataset['Severity'] = le.transform(dataset['Severity']) | |
| print(le.classes_) | |
| X = dataset[['Cause', 'Weekday', 'Year', 'Month', 'Point of accident']] |
This file contains hidden or 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
| def train_MLP(): | |
| le = preprocessing.LabelEncoder() | |
| le.fit(dataset['Cause']) | |
| dataset['Cause'] = le.transform(dataset['Cause']) | |
| le.fit(dataset['Severity']) | |
| dataset['Severity'] = le.transform(dataset['Severity']) | |
| print(le.classes_) | |
| X = dataset[['Cause', 'Weekday', 'Year', 'Month', 'Point of accident']] |
This file contains hidden or 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 CheckBox = styled.input` | |
| margin: 6px 10px 5.8px 3px; | |
| border-radius: 2px; | |
| border: solid 1px #c6c4d2; | |
| width: 5%; | |
| float: left; | |
| background: ${(porps) => (porps.checked ? '#482474' : '#fbfcff')}; | |
| ` | |
| const Container = styled.div` | |
| margin-bottom: 0px !important; |
This file contains hidden or 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 ListItem: React.FC<{ | |
| text: string | |
| handleOnChange: ChangeEventHandler | |
| selected: boolean | |
| }> = ({ text, handleOnChange, selected }) => { | |
| return ( | |
| <Container> | |
| <CheckBox | |
| type="checkbox" | |
| checked={selected} |
This file contains hidden or 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 React from 'react'; | |
| import ListItem from './ListItem'; | |
| import './App.css'; |
This file contains hidden or 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 [state, setState] = React.useState<{ selections: string[] }>({ selections: [] }); | |
| const options = ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6', 'Item 7', 'Item 8', 'Item 9'] |
This file contains hidden or 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
| function checkboxItems() { | |
| return ( | |
| <React.Fragment> | |
| {options.map((option) => ( | |
| <ListItem | |
| key={option} | |
| text={option} | |
| handleOnChange={() => handleCheckboxChange(option)} | |
| selected={state.selections.includes(option)} | |
| ></ListItem> |