投稿時間:2022-03-29 11:24:14 RSSフィード2022-03-29 11:00 分まとめ(26件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] Zホールディングス川辺、出沢CEOが語る展望 ヤフーとLINEの相互理解を深めて世界の“第3極”に https://www.itmedia.co.jp/business/articles/2203/29/news038.html itmedia 2022-03-29 10:30:00
IT ITmedia 総合記事一覧 [ITmedia News] LinkedInでAI生成の偽プロフィール画像によるリードジェネレーション──NPR報道 https://www.itmedia.co.jp/news/articles/2203/29/news085.html itmedianewslinkedin 2022-03-29 10:22:00
TECH Techable(テッカブル) “スマート日めくり”ではじめる毎日の運動習慣。オンラインフィットネス「CALENDAR」 https://techable.jp/archives/176046 calendar 2022-03-29 01:00:09
js JavaScriptタグが付けられた新着投稿 - Qiita 【パブリッシャー】HTMLとJavaScriptでカスタムレポートを作成してみる https://qiita.com/Miki_Yokohata/items/ea5c34b327eec1872c6e このようにして公開クエリで定義されたデータは、JavaScriptコード側で使用できます。 2022-03-29 10:44:23
AWS AWSタグが付けられた新着投稿 - Qiita 【CDK】セキュリティ関連サービスのSlack通知を検証 https://qiita.com/hedgehog051/items/4d475cc8c1513f9bc098 ・関連記事【CDK】CostAnomalyDetectionがChatbotと統合されたのでCDKで実装してみた【アップデート】【CDK】ECRイメージスキャンの結果をchatbot経由でslackに通知させるSecurityHubQAWSSecurityHubとは何ですかAWSSecurityHubは、AWS内のセキュリティの状態と、セキュリティ標準およびベストプラクティスに準拠しているかどうかを、包括的に把握できるようにします。 2022-03-29 10:31:23
技術ブログ Developers.IO 「Fast Notion」瞬時にスマホからNotionにメモを残せるアプリの紹介 https://dev.classmethod.jp/articles/fast-notion-introduce/ fastnotion 2022-03-29 01:00:58
海外TECH DEV Community Building a Calorie Tracker App in Flutter https://dev.to/shehanat/building-a-calorie-tracker-app-in-flutter-54l2 Building a Calorie Tracker App in FlutterIn order to get a firm understanding of any new programming language we might be learning it is best to build a simple application with that language in order to actively learn its pros cons and its intricacies  What better way to learn Flutter than to build a Calorie Tracker app with it In this tutorial post I will cover how to build a Calorie Tracker app using Flutter so let s get started What We Will BuildHere are some screenshots of the Calorie Tracker application that we will build Figure Screenshots of the Calorie Tracker App we re about to build SetupGitHub Starter Template Here In order to follow along in this tutorial I highly recommend using the starter template project posted above as this will quicken the development process for all of us Then make sure to install Flutter at the following link  Finally we ll need a Firebase project for the application we re building so make sure to head over to the Firebase Console and create a new project if you haven t already As for the development environment I ll be using VSCode download link here so if you don t have it installed you can do so now Alternatively using Android Studio download link here is also possible Setting up Firebase Once you have a Firebase project up and running the project creation process will allow you to download a google services json file Make sure to place this file in the root dir android app directory as this is how our Flutter application is able to connect with our Firebase project  We will be using the Firestore database as our data source for this application so let s create a Firestore database instance In the Firebase Console click on the Firestore Database tab and then click on Create Database as shown in this screenshot img alt Firebase Firestore lt br gt Database height src dev to uploads s amazonaws com uploads articles obropfzajcdyqinv png width Then select Start in Test Mode in the modal pop up select a region closed to you and create the database Installing PackagesFirst visit the starter template link above and clone the starter template branch into your local machine Then open it up in VSCode and run the following command in a Git Bash terminal instance while at the root directory of this project flutter pub getThis command is used to install all the necessary package used in this application most notability the charts flutter library Adding code to filesNow comes the development part First let s add the following code to the main dart file import package calorie tracker app src model food track task dart import package calorie tracker app src page day view day view dart import package calorie tracker app src page settings settings screen dart import package flutter material dart import src page history history screen dart import package firebase core firebase core dart import package provider provider dart import package calorie tracker app src providers theme notifier dart import package calorie tracker app src services shared preference service dart import package calorie tracker app helpers theme dart import package calorie tracker app routes router dart import package firebase database firebase database dart Future lt void gt main async WidgetsFlutterBinding ensureInitialized await Firebase initializeApp await SharedPreferencesService init runApp CalorieTrackerApp class CalorieTrackerApp extends StatefulWidget override CalorieTrackerAppState createState gt CalorieTrackerAppState class CalorieTrackerAppState extends State lt CalorieTrackerApp gt DarkThemeProvider themeChangeProvider DarkThemeProvider late Widget homeWidget late bool signedIn override void initState super initState checkFirstSeen void checkFirstSeen final bool firstLaunch true if firstLaunch homeWidget Homepage setState override Widget build BuildContext context return ChangeNotifierProvider lt DarkThemeProvider gt create return themeChangeProvider child Consumer lt DarkThemeProvider gt builder BuildContext context DarkThemeProvider value Widget child return GestureDetector onTap gt hideKeyboard context child MaterialApp debugShowCheckedModeBanner false builder Widget child gt ScrollConfiguration behavior MyBehavior child child theme themeChangeProvider darkTheme darkTheme lightTheme home homeWidget onGenerateRoute RoutePage generateRoute void hideKeyboard BuildContext context final FocusScopeNode currentFocus FocusScope of context if currentFocus hasPrimaryFocus amp amp currentFocus focusedChild null FocusManager instance primaryFocus unfocus class Homepage extends StatefulWidget const Homepage Key key super key key override Widget build BuildContext context return Scaffold body Center child FlatButton onPressed Navigate back to homepage child const Text Go Back override State lt StatefulWidget gt createState return Homepage class Homepage extends State lt Homepage gt with SingleTickerProviderStateMixin override void initState super initState void onClickHistoryScreenButton BuildContext context Navigator of context push MaterialPageRoute builder context gt HistoryScreen void onClickSettingsScreenButton BuildContext context Navigator of context push MaterialPageRoute builder context gt SettingsScreen void onClickDayViewScreenButton BuildContext context Navigator of context push MaterialPageRoute builder context gt DayViewScreen override Widget build BuildContext context final ButtonStyle buttonStyle ElevatedButton styleFrom textStyle const TextStyle fontSize return Scaffold appBar AppBar title Text Flutter Calorie Tracker App style TextStyle color Colors white fontSize fontWeight FontWeight bold body new Column children lt Widget gt new ListTile leading const Icon Icons food bank title new Text Welcome To Calorie Tracker App textAlign TextAlign center style const TextStyle fontWeight FontWeight bold new ElevatedButton onPressed onClickDayViewScreenButton context child Text Day View Screen new ElevatedButton onPressed onClickHistoryScreenButton context child Text History Screen new ElevatedButton onPressed onClickSettingsScreenButton context child Text Settings Screen class MyBehavior extends ScrollBehavior override Widget buildViewportChrome BuildContext context Widget child AxisDirection axisDirection return child Now for an explanation of the important parts of the above code Future lt void gt main async Instead of the standard void main method we have to specify the return type as Future lt void gt because we are using the async and await keywords in this method Since these keywords are asynchronous we have to adjust the return type of the method accordingly class CalorieTrackerApp This class is the main entrypoint of the application It responsible for rendering the Homepage widget when the app is first launched Its build method does the rendering and uses the ChangeNotifierProvider provider wrapper class to set a dark theme for the entire application with the help of DarkThemeProviderclass Homepage This class is the home screen for the application This class renders three buttons for navigating to the Day View History and Settings screens of the application We use the Navigator of context push MaterialPageRoute builder context gt DayViewScreen statement to switch to the desired screenNow let s build out the model files starting with lib src model food track task dart import package json annotation json annotation dart import package calorie tracker app src utils uuid dart import package firebase database firebase database dart JsonSerializable class FoodTrackTask String id String food name num calories num carbs num fat num protein String mealTime DateTime createdOn num grams FoodTrackTask required this food name required this calories required this carbs required this protein required this fat required this mealTime required this createdOn required this grams String id this id id Uuid generateV factory FoodTrackTask fromSnapshot DataSnapshot snap gt FoodTrackTask food name snap child food name value as String calories snap child calories as int carbs snap child carbs value as int fat snap child fat value as int protein snap child protein value as int mealTime snap child mealTime value as String grams snap child grams value as int createdOn snap child createdOn value as DateTime Map lt String dynamic gt toMap return lt String dynamic gt mealTime mealTime food name food name calories calories carbs carbs protein protein fat fat grams grams createdOn createdOn FoodTrackTask fromJson Map lt dynamic dynamic gt json id json id mealTime json mealTime calories json calories createdOn DateTime parse json createdOn food name json food name carbs json carbs fat json fat protein json protein grams json grams Map lt dynamic dynamic gt toJson gt lt dynamic dynamic gt id id mealTime mealTime createdOn createdOn toString food name food name calories calories carbs carbs fat fat protein protein grams grams So this model class is the primary class that will hold the information of each food tracking instance The mealTime field defines the time in which the food was consumed the createdOn field defines the time in which it was tracked and the carbs fat protein and grams fields convey the quality and nutritional value of the food consumed Next is a relatively minor model class lib src model food track entry dart class FoodTrackEntry DateTime date int calories FoodTrackEntry this date this calories This class will be used as entry points for the charts flutter Time Series chart that we ll be developing in the History Screen Next up is the developing of the services folder We ll start with the lib src services database dart file import package calorie tracker app src model food track task dart import package cloud firestore cloud firestore dart class DatabaseService final String uid final DateTime currentDate DatabaseService required this uid required this currentDate final DateTime today DateTime DateTime now year DateTime now month DateTime now day final DateTime weekStart DateTime collection reference final CollectionReference foodTrackCollection FirebaseFirestore instance collection foodTracks Future addFoodTrackEntry FoodTrackTask food async return await foodTrackCollection doc food createdOn millisecondsSinceEpoch toString set food name food food name calories food calories carbs food carbs fat food fat protein food protein mealTime food mealTime createdOn food createdOn grams food grams Future deleteFoodTrackEntry FoodTrackTask deleteEntry async print deleteEntry toString return await foodTrackCollection doc deleteEntry createdOn millisecondsSinceEpoch toString delete List lt FoodTrackTask gt scanListFromSnapshot QuerySnapshot snapshot return snapshot docs map doc return FoodTrackTask id doc id food name doc food name calories doc calories carbs doc carbs fat doc fat protein doc protein mealTime doc mealTime createdOn doc createdOn toDate DateTime now grams doc grams toList Stream lt List lt FoodTrackTask gt gt get foodTracks return foodTrackCollection snapshots map scanListFromSnapshot Future lt List lt dynamic gt gt getAllFoodTrackData async QuerySnapshot snapshot await foodTrackCollection get List lt dynamic gt result snapshot docs map doc gt doc data toList return result Future lt String gt getFoodTrackData String uid async DocumentSnapshot snapshot await foodTrackCollection doc uid get return snapshot toString Now for an explanation for it This is the class used to interact with the Firebase Firestore instance we created in the previous stepsuid This is the universal identifier for the Firestore instance This value can be found by accessing the Firestore database in the Firebase ConsolefoodTrackCollection This is the FirebaseFirestore instance that allows us to connect to the foodTracks collection in the Firestore database we previously createdaddFoodTrackEntry FoodTrackTask food This is the method used to create a new record in the foodTracks Firestore collection Notice that the record identifier is the millisecondsSinceEpoch value based on the FoodTrackTask instance s createdOn field This is done to ensure uniqueness in the collectiondeleteFoodTrackEntry FoodTrackTask deleteEntry This is the method used to delete a record in the foodTracks Firestore collection It uses the millisecondsSinceEpoch value based on the createdOn field from the FoodTrackTask instance that is passed in as a parameter to identify the record to be deleted scanListFromSnapshot QuerySnapshot snapshot This method is used to convert the data in the QuerySnapshot response object from Firestore to a List of FoodTrackTask instances We use the popular map function in order to do soget foodtracks This method only used by a StreamProvider instance in the Day View screen we ll get to building it soon to provide a list of FoodTrackTask instances that will be displayed in a list formatgetAllFoodTrackData This method is used to fetch all foodTrack records from the database and return them in a List lt dynamic gt object Note that we should avoid using the dynamic data type whenever possible but it would be acceptable in this context because we re not sure of what is being returned as a response from the database More on the dynamic data type in the flutterbyexample com site getFoodTrackData String uid This method is used to fetch a specific document from the Firestore database based on its universal identifier It can also provide the same result as the getAllFoodTrackData method if the uid is set to the collection nameOk making progress Next let s build out the lib src services shared preference service dart file import package shared preferences shared preferences dart class SharedPreferencesService static late SharedPreferences sharedPreferences Future lt void gt init async sharedPreferences await SharedPreferences getInstance static String sharedPreferenceDarkThemeKey DARKTHEME static Future lt bool gt setDarkTheme required bool to async return sharedPreferences setBool sharedPreferenceDarkThemeKey to static bool getDarkTheme return sharedPreferences getBool sharedPreferenceDarkThemeKey true Here is its explanation The shared preferences package is used for the common tasks of storing and caching values on disk This service class will serve to return instances of the SharedPreferences class and therefore follows the Singleton design patternOn top of the above functionality this class also assists in providing the dark theme functionality described in the main dart file through the getDarkTheme methodOk on to the providers folder where we ll build the lib src providers theme notifier dart file import package flutter cupertino dart import package shared preferences shared preferences dart import package calorie tracker app src services shared preference service dart class DarkThemeProvider with ChangeNotifier The with keyword is similar to mixins in JavaScript in that it is a way of reusing a class s fields methods in a different class that is not a super class of the initial class bool get darkTheme return SharedPreferencesService getDarkTheme set dartTheme bool value SharedPreferencesService setDarkTheme to value notifyListeners This class will serve as a provider to the CalorieTrackerAppState class in the main dart file while also enabling the dark theme that the application will use by default as of now Providers are important because they help reduce inefficiencies having to do with re rendering components whenever state changes occur When using providers the only widgets that have to be rebuilt whenever state changes occur are the ones that are assigned as consumers to their appropriate providers More on Providers and Consumers in this great blog postMoving on to the utils folder Let s build the lib src utils charts datetime series chart dart file now import package charts flutter flutter dart as charts import package firebase database firebase database dart import package firebase core firebase core dart import package flutter material dart import dart convert import package http http dart as http import package intl intl dart import package calorie tracker app src services database dart import package calorie tracker app src model food track task dart import package calorie tracker app src model food track entry dart class DateTimeChart extends StatefulWidget override DateTimeChart createState gt DateTimeChart class DateTimeChart extends State lt DateTimeChart gt List lt charts Series lt FoodTrackEntry DateTime gt gt resultChartData null DatabaseService databaseService new DatabaseService uid calorie tracker bd currentDate DateTime now override void initState super initState getAllFoodTrackData void getAllFoodTrackData async List lt dynamic gt foodTrackResults await databaseService getAllFoodTrackData List lt FoodTrackEntry gt foodTrackEntries for var foodTrack in foodTrackResults if foodTrack createdOn null foodTrackEntries add FoodTrackEntry foodTrack createdOn toDate foodTrack calories populateChartWithEntries foodTrackEntries void populateChartWithEntries List lt FoodTrackEntry gt foodTrackEntries async Map lt String int gt caloriesByDateMap new Map if foodTrackEntries null var dateFormat DateFormat yyyy MM dd for var foodEntry in foodTrackEntries var trackedDateStr foodEntry date DateTime dateNow DateTime now var trackedDate dateFormat format trackedDateStr if caloriesByDateMap containsKey trackedDate caloriesByDateMap trackedDate caloriesByDateMap trackedDate foodEntry calories else caloriesByDateMap trackedDate foodEntry calories List lt FoodTrackEntry gt caloriesByDateTimeMap for var foodEntry in caloriesByDateMap keys DateTime entryDateTime DateTime parse foodEntry caloriesByDateTimeMap add new FoodTrackEntry entryDateTime caloriesByDateMap foodEntry caloriesByDateTimeMap sort a b int aDate a date microsecondsSinceEpoch int bDate b date microsecondsSinceEpoch return aDate compareTo bDate setState resultChartData new charts Series lt FoodTrackEntry DateTime gt id Food Track Entries colorFn gt charts MaterialPalette blue shadeDefault domainFn FoodTrackEntry foodTrackEntry gt foodTrackEntry date measureFn FoodTrackEntry foodTrackEntry gt foodTrackEntry calories labelAccessorFn FoodTrackEntry foodTrackEntry gt foodTrackEntry date foodTrackEntry calories data caloriesByDateTimeMap override Widget build BuildContext context if resultChartData null return Scaffold body new Center child new Column mainAxisAlignment MainAxisAlignment center children lt Widget gt Text Caloric Intake By Date Chart new Padding padding new EdgeInsets all child new SizedBox height child charts TimeSeriesChart resultChartData animate true else return CircularProgressIndicator Here is its explanation This class is responsible for displaying a Time Series chart that will be shown in the History screeninitState In the initState lifecycle method we will call the getAllFoodTrackData method in order to fetch all the FoodTrackEntry objects from the Firestore databasegetAllFoodTrackData This method fetches all records from the foodTracks collection converts them into FoodTrackEntry instances and adds them to a List Finally it calls the populateChartWithEntries method as the name sounds to populate the Time Series chartpopulateChartWithEntries This method converts the List lt FoodTrackEntry gt list passed in as a parameter into another List lt FoodTrackEntry gt list that aggregates the calorie amounts based on the date For example if there are FoodTrackEntry instances with a date value of and calorie values of and respectively then the new List lt FoodTrackEntry gt list would only contain one FoodTrackEntry instance with a date value of and a calorie value of Doing so allows us to chart the caloric intake of the user by date Once the new List lt FoodTrackEntry gt has been created the setState method will reassign the value of the resultChartData variable Consequently the widget will be rebuilt and the charts TimeSeriesChart widget will display the updated chart databuild This method will render a Scaffold layout containing the title of the Time Series chart and the actual Time Series chart itselfOk let s move on to some files where we will defined some constant values Here s lib src utils constants dart const DATABASE UID lt ENTER YOUR COLLECTION ID HERE gt The collection ID that this file requires can be found in the Firebase Console s Firestore Database page img alt Firestore Database page showing Collection lt br gt ID height src dev to uploads s amazonaws com uploads articles slxwthdlspmbeoa png width Figure Firestore Database page showing Collection IDand then here s lib src utils theme colors dart const CARBS COLOR xffD const PROTEIN COLOR xD const FAT COLOR xFFDA These color codes will be used to define the colors used in the Day View screen Feel free to change them based on your preferences And to wrap up with the utils folder let build out the lib src utils uuid dart file import dart math class Uuid final Random random Random String generateV final int special random nextInt return bitsDigits bitsDigits bitsDigits bitsDigits printDigits special bitsDigits bitsDigits bitsDigits bitsDigits String bitsDigits int bitCount int digitCount gt printDigits generateBits bitCount digitCount int generateBits int bitCount gt random nextInt lt lt bitCount String printDigits int value int count gt value toRadixString padLeft count This class basically generates random universally unique identifiers most frequently used as IDs when creating new instances of model classes Now we can start adding code to the files in the pages folder We are about to build the Day View screen so here is a screenshot of it Figure Day View ScreenNow that you have a better idea of how its supposed to look like let s begin with the lib src page day view calorie stats dart file import package calorie tracker app src model food track task dart import package flutter material dart import package provider provider dart import package fl chart fl chart dart import package calorie tracker app src utils theme colors dart class CalorieStats extends StatelessWidget DateTime datePicked DateTime today DateTime now CalorieStats required this datePicked num totalCalories num totalCarbs num totalFat num totalProtein num displayCalories bool dateCheck DateTime formatPicked DateTime datePicked year datePicked month datePicked day DateTime formatToday DateTime today year today month today day if formatPicked compareTo formatToday return true else return false static List lt num gt macroData override Widget build BuildContext context final DateTime curDate new DateTime datePicked year datePicked month datePicked day final foodTracks Provider of lt List lt FoodTrackTask gt gt context List findCurScans List lt FoodTrackTask gt foodTracks List currentFoodTracks foodTracks forEach foodTrack DateTime trackDate DateTime foodTrack createdOn year foodTrack createdOn month foodTrack createdOn day if trackDate compareTo curDate currentFoodTracks add foodTrack return currentFoodTracks List currentFoodTracks findCurScans foodTracks void findNutriments List foodTracks foodTracks forEach scan totalCarbs scan carbs totalFat scan fat totalProtein scan protein displayCalories scan calories totalCalories totalFat totalCarbs totalProtein findNutriments currentFoodTracks ignore deprecated member use List lt PieChartSectionData gt sections lt PieChartSectionData gt PieChartSectionData fat PieChartSectionData color Color FAT COLOR value totalFat totalCalories title totalFat totalCalories toStringAsFixed radius titleStyle TextStyle color Colors white fontSize PieChartSectionData carbohydrates PieChartSectionData color Color CARBS COLOR value totalCarbs totalCalories title totalCarbs totalCalories toStringAsFixed radius titleStyle TextStyle color Colors black fontSize PieChartSectionData protein PieChartSectionData color Color PROTEIN COLOR value totalProtein totalCalories title totalProtein totalCalories toStringAsFixed radius titleStyle TextStyle color Colors white fontSize sections fat protein carbohydrates macroData displayCalories totalProtein totalCarbs totalFat totalCarbs totalFat totalProtein displayCalories Widget chartLabels return Padding padding EdgeInsets only top child Column crossAxisAlignment CrossAxisAlignment start children lt Widget gt Row children lt Widget gt Text Carbs style TextStyle color Color CARBS COLOR fontFamily Open Sans fontSize fontWeight FontWeight w Text macroData toStringAsFixed g style TextStyle color Color fromARGB fontFamily Open Sans fontSize fontWeight FontWeight w SizedBox height Row children lt Widget gt Text Protein style TextStyle color Color xffFA fontFamily Open Sans fontSize fontWeight FontWeight w Text macroData toStringAsFixed g style TextStyle color Color fromARGB fontFamily Open Sans fontSize fontWeight FontWeight w SizedBox height Row children lt Widget gt Text Fat style TextStyle color Color xffBBC fontFamily Open Sans fontSize fontWeight FontWeight w Text macroData toStringAsFixed g style TextStyle color Color fromARGB fontFamily Open Sans fontSize fontWeight FontWeight w Widget calorieDisplay return Container height width decoration BoxDecoration color Color xffFAA shape BoxShape circle child Column crossAxisAlignment CrossAxisAlignment center mainAxisAlignment MainAxisAlignment center children lt Widget gt Text macroData toStringAsFixed style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Text kcal style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w if currentFoodTracks length if dateCheck return Flexible fit FlexFit loose child Text Add food to see calorie breakdown textAlign TextAlign center style TextStyle fontSize fontWeight FontWeight w else return Flexible fit FlexFit loose child Text No food added on this day textAlign TextAlign center style TextStyle fontSize fontWeight FontWeight w else return Container child Row children lt Widget gt Stack alignment Alignment center children lt Widget gt AspectRatio aspectRatio child PieChart PieChartData sections sections borderData FlBorderData show false centerSpaceRadius sectionsSpace calorieDisplay chartLabels Here is the explanation for it The datePicked totalCalories totalCarbs totalProtein displayCalories variables store the nutritional data for the date pickeddateCheck This method checks if the datePicked DateTime value is equivalent to today s date This method is used for prompting the user to add food in the current Day View pagemacroData This array is used to store the macro nutritional values and quantity carbs protein fat and grams of each type of food that is added in the Day View Screenbuild BuildContext context This method renders the pie chart display of the macro nutritional ratios and the macro quantities of the three macro nutritional groupsNext up is the lib src page day view dart file Here is its code import package flutter material dart import package flutter services dart import package calorie tracker app src model food track task dart import package calorie tracker app component iconpicker icon picker builder dart import package calorie tracker app src utils charts datetime series chart dart import calorie stats dart import package provider provider dart import package calorie tracker app src services database dart import package openfoodfacts model Product dart import package openfoodfacts openfoodfacts dart import dart math import package calorie tracker app src utils theme colors dart import package calorie tracker app src utils constants dart class DayViewScreen extends StatefulWidget DayViewScreen override State lt StatefulWidget gt createState return DayViewState class DayViewState extends State lt DayViewScreen gt String title Add Food double servingSize String dropdownValue grams DateTime value DateTime now DateTime today DateTime now Color rightArrowColor Color xffCCC Color leftArrowColor Color xffCCC final addFoodKey GlobalKey lt FormState gt DatabaseService databaseService new DatabaseService uid calorie tracker bd currentDate DateTime now late FoodTrackTask addFoodTrack override void initState super initState addFoodTrack FoodTrackTask food name calories carbs protein fat mealTime createdOn value grams databaseService getFoodTrackData DATABASE UID void resetFoodTrack addFoodTrack FoodTrackTask food name calories carbs protein fat mealTime createdOn value grams Widget calorieCounter return Padding padding EdgeInsets fromLTRB child new Container decoration BoxDecoration color Colors white border Border bottom BorderSide color Colors grey withOpacity width height child Row children lt Widget gt CalorieStats datePicked value Widget addFoodButton return IconButton icon Icon Icons add box iconSize color Colors white onPressed async setState showFoodToAdd context Future selectDate async DateTime picked await showDatePicker context context initialDate value firstDate new DateTime lastDate new DateTime now builder BuildContext context Widget child return Theme data ThemeData light copyWith primaryColor const Color xffFAA Head background child child if picked null setState gt value picked stateSetter void stateSetter if today difference value compareTo Duration days setState gt rightArrowColor Color xffEDEDED else setState gt rightArrowColor Colors white checkFormValid if addFoodTrack calories amp amp addFoodTrack carbs amp amp addFoodTrack protein amp amp addFoodTrack fat amp amp addFoodTrack grams return true return false showFoodToAdd BuildContext context return showDialog context context builder context return AlertDialog title Text title content showAmountHad actions lt Widget gt FlatButton onPressed gt Navigator pop context passing false child Text Cancel FlatButton onPressed async if checkFormValid Navigator pop context var random new Random int randomMilliSecond random nextInt addFoodTrack createdOn value addFoodTrack createdOn addFoodTrack createdOn add Duration milliseconds randomMilliSecond databaseService addFoodTrackEntry addFoodTrack resetFoodTrack else ScaffoldMessenger of context showSnackBar SnackBar content Text Invalid form data All numeric fields must contain numeric values greater than backgroundColor Colors white child Text Ok Widget showAmountHad return new Scaffold body Column children lt Widget gt showAddFoodForm showUserAmount Widget showAddFoodForm return Form key addFoodKey child Column children TextFormField decoration const InputDecoration labelText Name hintText Please enter food name validator value if value null value isEmpty return Please enter the food name return null onChanged value addFoodTrack food name value addFood calories value TextFormField decoration const InputDecoration labelText Calories hintText Please enter a calorie amount validator value if value null value isEmpty return Please enter a calorie amount return null keyboardType TextInputType number onChanged value try addFoodTrack calories int parse value catch e return Please enter numeric values addFoodTrack calories addFood calories value TextFormField decoration const InputDecoration labelText Carbs hintText Please enter a carbs amount validator value if value null value isEmpty return Please enter a carbs amount return null keyboardType TextInputType number onChanged value try addFoodTrack carbs int parse value catch e addFoodTrack carbs TextFormField decoration const InputDecoration labelText Protein hintText Please enter a protein amount validator value if value null value isEmpty return Please enter a calorie amount return null onChanged value try addFoodTrack protein int parse value catch e addFoodTrack protein TextFormField decoration const InputDecoration labelText Fat hintText Please enter a fat amount validator value if value null value isEmpty return Please enter a fat amount return null onChanged value try addFoodTrack fat int parse value catch e addFoodTrack fat Widget showUserAmount return new Expanded child new TextField maxLines autofocus true decoration new InputDecoration labelText Grams hintText eg contentPadding EdgeInsets all keyboardType TextInputType number inputFormatters lt TextInputFormatter gt FilteringTextInputFormatter digitsOnly onChanged value try addFoodTrack grams int parse value catch e addFoodTrack grams setState servingSize double tryParse value Widget showDatePicker return Container width child Row mainAxisSize MainAxisSize max mainAxisAlignment MainAxisAlignment spaceBetween children lt Widget gt IconButton icon Icon Icons arrow left size color leftArrowColor onPressed setState value value subtract Duration days rightArrowColor Colors white TextButton textColor Colors white onPressed gt selectDate child Text dateFormatter value style TextStyle fontFamily Open Sans fontSize fontWeight FontWeight w IconButton icon Icon Icons arrow right size color rightArrowColor onPressed if today difference value compareTo Duration days setState rightArrowColor Color xffCCC else setState value value add Duration days if today difference value compareTo Duration days setState rightArrowColor Color xffCCC String dateFormatter DateTime tm DateTime today new DateTime now Duration oneDay new Duration days Duration twoDay new Duration days String month switch tm month case month Jan break case month Feb break case month Mar break case month Apr break case month May break case month Jun break case month Jul break case month Aug break case month Sep break case month Oct break case month Nov break case month Dec break default month Undefined break Duration difference today difference tm if difference compareTo oneDay lt return Today else if difference compareTo twoDay lt return Yesterday else return tm day month tm year override Widget build BuildContext context return Scaffold appBar AppBar elevation bottom PreferredSize preferredSize const Size fromHeight child Row mainAxisAlignment MainAxisAlignment spaceBetween children lt Widget gt showDatePicker addFoodButton body StreamProvider lt List lt FoodTrackTask gt gt value initialData value new DatabaseService uid calorie tracker bd currentDate DateTime now foodTracks child new Column children lt Widget gt calorieCounter Expanded child ListView children lt Widget gt FoodTrackList datePicked value class FoodTrackList extends StatelessWidget final DateTime datePicked FoodTrackList required this datePicked override Widget build BuildContext context final DateTime curDate new DateTime datePicked year datePicked month datePicked day final foodTracks Provider of lt List lt FoodTrackTask gt gt context List findCurScans List foodTrackFeed List curScans foodTrackFeed forEach foodTrack DateTime scanDate DateTime foodTrack createdOn year foodTrack createdOn month foodTrack createdOn day if scanDate compareTo curDate curScans add foodTrack return curScans List curScans findCurScans foodTracks return ListView builder scrollDirection Axis vertical physics ClampingScrollPhysics shrinkWrap true itemCount curScans length itemBuilder context index if index lt curScans length return FoodTrackTile foodTrackEntry curScans index else return SizedBox height class FoodTrackTile extends StatelessWidget final FoodTrackTask foodTrackEntry DatabaseService databaseService new DatabaseService uid calorie tracker bd currentDate DateTime now FoodTrackTile required this foodTrackEntry List macros CalorieStats macroData override Widget build BuildContext context return ExpansionTile leading CircleAvatar radius backgroundColor Color xffFAA child itemCalories title Text foodTrackEntry food name style TextStyle fontSize fontFamily Open Sans fontWeight FontWeight w subtitle macroData children lt Widget gt expandedView context Widget itemCalories return Column crossAxisAlignment CrossAxisAlignment center mainAxisAlignment MainAxisAlignment center children lt Widget gt Text foodTrackEntry calories toStringAsFixed style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Text kcal style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Widget macroData return Row children lt Widget gt Container width child Row mainAxisAlignment MainAxisAlignment spaceBetween children lt Widget gt Row children lt Widget gt Container height width decoration BoxDecoration color Color CARBS COLOR shape BoxShape circle Text foodTrackEntry carbs toStringAsFixed g style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Container height width decoration BoxDecoration color Color PROTEIN COLOR shape BoxShape circle Text foodTrackEntry protein toStringAsFixed g style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Container height width decoration BoxDecoration color Color FAT COLOR shape BoxShape circle Text foodTrackEntry fat toStringAsFixed g style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Text foodTrackEntry grams toString g style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w Widget expandedView BuildContext context return Padding padding EdgeInsets fromLTRB child Column crossAxisAlignment CrossAxisAlignment start children lt Widget gt expandedHeader context expandedCalories expandedCarbs expandedProtein expandedFat Widget expandedHeader BuildContext context return Row mainAxisAlignment MainAxisAlignment spaceBetween children lt Widget gt Text of total style TextStyle fontSize color Colors white fontFamily Open Sans fontWeight FontWeight w IconButton icon Icon Icons delete iconSize onPressed async print Delete button pressed databaseService deleteFoodTrackEntry foodTrackEntry Widget expandedCalories double caloriesValue if foodTrackEntry calories macros isNaN caloriesValue foodTrackEntry calories macros return Padding padding EdgeInsets fromLTRB child Row children lt Widget gt Container height width child LinearProgressIndicator value caloriesValue backgroundColor Color xffEDEDED valueColor AlwaysStoppedAnimation lt Color gt Color xffFAA Text caloriesValue toStringAsFixed Widget expandedCarbs double carbsValue if foodTrackEntry carbs macros isNaN carbsValue foodTrackEntry carbs macros return Padding padding EdgeInsets fromLTRB child Row children lt Widget gt Container height width child LinearProgressIndicator value carbsValue backgroundColor Color xffEDEDED valueColor AlwaysStoppedAnimation lt Color gt Color xffFA Text carbsValue toStringAsFixed Widget expandedProtein double proteinValue if foodTrackEntry protein macros isNaN proteinValue foodTrackEntry protein macros return Padding padding EdgeInsets fromLTRB child Row children lt Widget gt Container height width child LinearProgressIndicator value proteinValue backgroundColor Color xffEDEDED valueColor AlwaysStoppedAnimation lt Color gt Color xffFA Text proteinValue toStringAsFixed Widget expandedFat double fatValue if foodTrackEntry fat macros isNaN fatValue foodTrackEntry fat macros return Padding padding EdgeInsets fromLTRB child Row children lt Widget gt Container height width child LinearProgressIndicator value foodTrackEntry fat macros backgroundColor Color xffEDEDED valueColor AlwaysStoppedAnimation lt Color gt Color xffBBC Text fatValue toStringAsFixed Now for its explanation createState This method creates a mutable state for the DayViewScreen widget value This DateTime value holds the current date that the Day View screen is set to The left and right arrow buttons allow the user to switch dates accordingly which will be updated in the value variabledatabaseService This is the DatebaseService instance used to fetch and add records to the foodTracks collection in the Firestore database we setup in previous stepsinitState This lifecycle method initializes the addFoodTrack variable to an empty FoodTrackTask instance Then databaseService getFoodTrackData is called to fetch all the FoodTrack instances from the Firestore databaseresetFoodTrack This method is used to reset the addFoodTrack variable to an empty FoodTrack instance after adding a new FoodTrack instance in the Add Food modalThe addFoodButton showFoodToAdd showAmountHad showAddFoodForm and showUserAmount methods are used to render the Add Food Modal that popups when tapping the Add Food button showDatePicker This method renders the Date toggling mechanism on the top of the screenbuild In this render method we render the Add Food button and the Date picker widget onto the appBar Then in the body the DatabaseService class is used to fetch all foodTrack instances which will be listed using the StreamProvider class more on the StreamProvider class in the Flutter documentation The FoodTrackList class will render the listings It will required the value argument which is the date picked by the user which it will use to filter out the foodTrack instances that match that date to within a hour time period and render those instances according The FoodTrackTile class is used to render single items in the listing that the FoodTrackList class will render These items will show the calorie amount macro nutritional amounts and percentages of those values in comparison to the overall day s values in a chart format Lastly it will also render a delete button to delete any foodTrack instancesWhew Now that we have gotten through building the Day View screen let s build the History screen Here is a screenshot of how it looks Figure History ScreenAdd the following code to the lib src page history history screen dart file import package flutter material dart import package calorie tracker app src model food track task dart import package calorie tracker app component iconpicker icon picker builder dart import package calorie tracker app src utils charts datetime series chart dart class HistoryScreen extends StatefulWidget HistoryScreen override State lt StatefulWidget gt createState return HistoryScreenState class HistoryScreenState extends State lt HistoryScreen gt final GlobalKey lt ScaffoldState gt scaffoldKey new GlobalKey lt ScaffoldState gt bool isBack true override void initState super initState void onClickBackButton print Back Button Navigator of context pop override Widget build BuildContext context return Scaffold appBar AppBar title Text History Screen style TextStyle color Colors white fontSize fontWeight FontWeight bold body Container child DateTimeChart The History screen just renders a simple Time Series chart using the charts flutter library It uses the DateTimeChart widget covered in an earlier section of this post to accomplish this Last but not least we ll build the Settings screen We won t be providing any tangible functionality for it and will only be looking at building its UI Here is a screenshot of what it looks like Figure Settings ScreenAnd here its code which we ll add to the lib src page settings settings screen dart file import package flutter material dart import package calorie tracker app src model food track task dart import package calorie tracker app component iconpicker icon picker builder dart import package settings ui settings ui dart class SettingsScreen extends StatefulWidget SettingsScreen override State lt StatefulWidget gt createState return SettingsScreenState class SettingsScreenState extends State lt SettingsScreen gt final GlobalKey lt ScaffoldState gt scaffoldKey new GlobalKey lt ScaffoldState gt bool isBack true override void initState super initState override Widget build BuildContext context const IconData computer IconData xe fontFamily MaterialIcons return SettingsList sections SettingsSection title Text Settings textAlign TextAlign center style const TextStyle fontWeight FontWeight bold tiles SettingsTile title Text Language textAlign TextAlign center style const TextStyle fontWeight FontWeight bold value Text English textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons language onPressed BuildContext context SettingsTile title Text Environment textAlign TextAlign center style const TextStyle fontWeight FontWeight bold subtitle English value Text Development textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons computer onPressed BuildContext context SettingsTile title Text Environment textAlign TextAlign center style const TextStyle fontWeight FontWeight bold subtitle English value Text Development textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons language onPressed BuildContext context SettingsSection title Text Account textAlign TextAlign center style const TextStyle fontWeight FontWeight bold tiles SettingsTile title Text Phone Number textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons local phone SettingsTile title Text Email textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons email SettingsTile title Text Sign out textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons logout SettingsSection title Text Misc textAlign TextAlign center style const TextStyle fontWeight FontWeight bold tiles SettingsTile title Text Terms of Service textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons document scanner SettingsTile title Text Open source licenses textAlign TextAlign center style const TextStyle fontWeight FontWeight bold leading Icon Icons collections bookmark Not much to explain here other than that we are using the settings ui library see its GitHub page here to provide us with the SettingsSection SettingsList and SettingsTile widgets to create a typical setting screen as seen in most modern mobile applications Ok we have finished developing our application now Give yourself a pat on the back if you made it this far Now I give an brief summary of Routing in Flutter and how we chose to implement routing for this application Flutter has two types of routing Imperative routing via the Navigator widget and Idiomatic declarative routing via the Router widget Traditionally most web applications use idiomatic declarative routing while most mobile applications used some sort of imperative routing mechanism As a general guideline it is best to use Imperative routing for smaller Flutter applications and Idiomatic declarative routing for larger apps Accordingly we have chosen the Imperative routing mechanism for this application as evident by the Navigator of context push calls that are commonplace throughout this application Running And Testing The AppNow all that s left is to run the application via the VSCode Debugger if you re developing on VSCode or using the Run Icon if you re developing on Android Studio Here s an informative blog post on how to run Flutter applications on VSCode if you need help with that and here is one for running Flutter apps on Android Studio if you need it Here are some screenshots of what the app should look like Figure Screenshots of the Calorie Tracker App we ve just built ConclusionIf you managed to follow along Congrats You now know how to build a Calorie Tracker application on Flutter If not look into my GitHub source code repo for this app and feel free to clone it and replicate it as you wish Well that s all for today I hope you found this article helpful Thanks so much for reading my article Feel free to follow me on Twitter and GitHub connect with me on LinkedIn and subscribe to my YouTube channel 2022-03-29 01:48:20
海外TECH DEV Community Build Hadoop 2.X Fully distributed Environment by Ubuntu 16.04 https://dev.to/leifengflying/build-hadoop-2x-fully-distributed-environment-by-ubuntu-1604-173c Build Hadoop X Fully distributed Environment by Ubuntu ExperimentalmodelandarchitecturedescriptionBasicenvironmentconfigurationJDKHadoopenvironmentconfigurationHadoopconfigurationfilemodificationStartHadoopclusterallinAdServeroperationExperimentalmodelandarchitecturedescriptionWritteninthefrontthesepicturesarefromanotherblogofmineDontworryMyChineseBlogCSDNAddressThisexperimentusesthreeUbuntuinstanceHostNameIPAddressOSRunningServicesRoleadserverubuntuNameNode、SecondaryNameNode、ResourceManager、JobHistoryServerMastermonserverubuntuDataNode、NodeManagerSlaveosdserverubuntuDataNode、NodeManagerSlaveBasicenvironmentconfigurationChangeHostnameandthenetworkinterfacenameUbuntustaticIPaddressonlyChecktheIPaddressfirstModifythenetworkcardconfigurationfiletomakeitastaticIPaddressAftermodificationrestarttheinstancetotakeeffectsudovietcnetworkinterfacesModifyhostnameuseheresudohostnamectlsethostnameYOURHOSTNAMEModifyhostsandconfigureFQDNdomainnameCreateHadoopusersandconfigurepasswordfreeloginEachnodeneedstobeconfiguredsudouseradddhomehadoopmhadoopsudopasswdhadoopechohadoopALLrootNOPASSWDALLsudoteeetcsudoersdhadoopsudochmodetcsudoersdhadoopToconfigureSSHpasswordfreeloginyouneedtoinstallopensshserversudoaptgetinstallopensshserverfirstubuntuadserversshkeygenubuntuadserversshcopyidadserverubuntuadserversshcopyidmonserverubuntuadserversshcopyidosdserverubuntuadserversshcopyidisshidrsapubhadoopadserverubuntuadserversshcopyidisshidrsapubhadoopmonserverubuntuadserversshcopyidisshidrsapubhadooposdserverJDKHadoopenvironmentConfigureJDKenvironmentJdkuisusedhereDownloadJDKjdkulinuxxtargzubuntuadserverlslhtotalMrwrwrubuntuubuntuMMarjdkulinuxxtargzubuntuadservertarzxfjdkulinuxxtargzubuntuadserverlslhtotalMdrwxrxrxubuntuubuntuKMarjdkrwrwrubuntuubuntuMMarjdkulinuxxtargzubuntuadserversudomkdirusrlibjdkubuntuadserversudomvjdkusrlibjdkubuntuadserversudolsusrlibjdkjdkubuntuadserversudovietcprofileAddJDKenvironmentJDKexportJAVAHOMEusrlibjdkjdkexportJREHOMEJAVAHOMEjreexportCLASSPATHJAVAHOMElibJREHOMElibexportPATHJAVAHOMEbinPATHConfigureHadoopenvironmentDownloadHadoopHadoopDownloadLinkUnzipubuntuadservertarzxfhadooptargzubuntuadserverlslhMoveHadooptousrlocaldirectoryAddHadoopenvironmentvariablesudovietcprofileHADOOPexportHADOOPHOMEusrlocalhadoopexportPATHHADOOPHOMEbinHADOOPHOMEsbinPATHexportHADOOPCONFDIRHADOOPHOMEetchadoopvibashrcHADOOPexportHADOOPHOMEusrlocalhadoopexportPATHHADOOPHOMEbinHADOOPHOMEsbinPATHexportHADOOPCONFDIRHADOOPHOMEetchadoopsourceetcprofilesourcebashrchadoopversionHadoopconfigurationfilemodificationModifyHadoopconfigurationfileModifythehadoopetchadoopdirectoryhadoopenvsh、yarnenvsh、slaves、coresitexml、hdfssitexml、mapredsitexml、yarnsitexmlCreatethetmpfolderanditssubdirectoriesundertheHadoopdirectoryubuntuadserversudomkdirpusrlocalhadooptmpdfsdataubuntuadserversudomkdirpusrlocalhadooptmpdfsnameModifyprofileFirstenterthecorrespondingfolderubuntuadservercdusrlocalhadoopetchadoopAddJavaHometoHadoopenvironmentprofile①AddJavahometoHadoopenvshexportJAVAHOMEusrlibjdkjdk②AddJavahometoyarnenvSHjustadditdirectlyinthefirstlineexportJAVAHOMEusrlibjdkjdk③AddslavehostnametoslaveubuntuadserverusrlocalhadoopetchadoopvislavesmonserverosdserverModifythecorrespondingconfigurationfile④ModificationcoresitexmlubuntuadserverusrlocalhadoopetchadoopvicoresitexmlAddthefollowingcontentstoltconfigurationgtltconfigurationgtltpropertygtltnamegtfsdefaultFSltnamegtltvaluegthdfsadserverltvaluegtltpropertygtltpropertygtltnamegthadooptmpdirltnamegtltvaluegtfileusrlocalhadooptmpltvaluegtltdescriptiongtAbaseforothertemporarydirectoriesltdescriptiongtltpropertygt⑤ModifyhdfssitexmlfileubuntuadserverusrlocalhadoopetchadoopvihdfssitexmlAddthefollowingcontentstoltconfigurationgtltconfigurationgtltpropertygtltnamegtdfsnamenodesecondaryhttpaddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtdfsnamenodenamedirltnamegtltvaluegtfileusrlocalhadooptmpdfsnameltvaluegtltpropertygtltpropertygtltnamegtdfsdatanodedatadirltnamegtltvaluegtfileusrlocalhadooptmpdfsdataltvaluegtltpropertygtltpropertygtltnamegtdfsreplicationltnamegtltvaluegtltvaluegtltpropertygtltpropertygtltnamegtdfswebhdfsenabledltnamegtltvaluegttrueltvaluegtltpropertygt⑥ModifymapredsitexmlyouneedtocopythefileasmapredsitexmlandthenubuntuadserverusrlocalhadoopetchadoopcpmapredsitexmltemplatemapredsitexmlubuntuadserverusrlocalhadoopetchadoopvimapredsitexmlAddthefollowingcontentstoltconfigurationgtltconfigurationgtltpropertygtltnamegtmapreduceframeworknameltnamegtltvaluegtyarnltvaluegtltpropertygtltpropertygtltnamegtmapreducejobhistoryaddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtmapreducejobhistorywebappaddressltnamegtltvaluegtadserverltvaluegtltpropertygt⑦、ModifyyarnsitexmlubuntuadserverusrlocalhadoopetchadoopviyarnsitexmlAddthefollowingcontentstoltconfigurationgtltconfigurationgtltpropertygtltnamegtyarnnodemanagerauxservicesltnamegtltvaluegtmapreduceshuffleltvaluegtltpropertygtltpropertygtltnamegtyarnresourcemanagerscheduleraddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtyarnresourcemanageraddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtyarnresourcemanagerresourcetrackeraddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtyarnresourcemanageradminaddressltnamegtltvaluegtadserverltvaluegtltpropertygtltpropertygtltnamegtyarnresourcemanagerwebappaddressltnamegtltvaluegtadserverltvaluegtltpropertygtUsetheSCPcommandtoaddetchostsetcprofilebashrcJDKandHadooparedistributedtotwoslavenodesrespectivelyHereisonlyademonstrationofcopyingtomonserverubuntuadserverscpetchostsubuntumonserverubuntuadserverscpretcprofileubuntumonserverubuntuadserverscprbashrcubuntumonserverubuntuadserverscprusrlocalhadoopubuntumonserverubuntuadserverscprusrlibjdkubuntumonserverubuntumonserversudomvhostsetchostsubuntumonserversudomvhadoopusrlocalubuntumonserversudomvjdkusrlibubuntumonserversudoupdatealternativesinstallusrbinjavajavausrlibjdkjdkbinjavaubuntumonserversudoupdatealternativesinstallusrbinjavacjavacusrlibjdkjdkbinjavacubuntumonserversourceetcprofileubuntumonserversourcebashrcubuntumonserverjavaversionubuntumonserverhadoopversionSetthefolderpermissionsofallnodeshadooptoSetthefolderpermissionsofallnodeshadooptoSetthefolderpermissionsofallnodeshadooptoubuntuadserversudochmodRusrlocalhadoopubuntumonserversudochmodRusrlocalhadoopubuntuosdserversudochmodRusrlocalhadoopStartHadoopclusterallinAdServeroperation①initializationnamenodeubuntuadserverhadoopnamenodeformatNoteinitializationisrequiredforthefirstrunbutnotafterIfitrunssuccessfullyitshouldreturnexitingwithstatusandpromptshuttingdownnamenodeatAdServerxxxxxxxxxXXIPaddressofAdServerThespecificresultsareshowninthefigurebelow②StartHadoopdaemonsnamenodedatanodeResourceManagernodemanageretcA、StartnamenodesecondarynamenodeanddatanodefirstExecuteontheAdServernodeubuntuadserverstartdfsshAtthistimetheprocessesrunningonthemasternodeareNameNode、SecondaryNameNodeAtthistimetheprocessesrunningontheslavenodeareDataNodeB、StartResourceManager、NodeManagerstartyarnshYarnisseparatedfromMapReduceandisresponsibleforresourcemanagementandtaskschedulingYarnrunsonMapReduceandprovideshighavailabilityandscalabilityAtthistimetheprocessesrunningonthemasternodeareNameNode、SecondaryNameNode、ResourceManagerTheprocessesrunningontheslavenodeareDataNode、NodeManagerC、StartJobHistoryServermrjobhistorydaemonshstarthistoryserverNoteajobhistoryserverprocesswillbeaddedtothemasternodeAfterTMPandlogPdirectoriesoneachnodearecreatedseveraltimesbesuretodeletethemagainViewtheoperationstatusofthreenodesubuntuadserverjpsubuntuadserversshmonserverusrlibjdkjdkbinjpsubuntuadserversshosdserverusrlibjdkjdkbinjpsIfthisarticleishelpfultoyoupleaselikeitThankyouHaveaNiceDay 2022-03-29 01:30:22
金融 ニッセイ基礎研究所 経過措置の期限設定と「適合計画書」開示企業の取組みに注目~東証市場再編後の課題~ https://www.nli-research.co.jp/topics_detail1/id=70660?site=nli 目次はじめに上場基準と各市場のコンセプトを明確化流通株式時価総額の未達企業が多く、未達基準の達成予定は年後が多い明確化した上場基準の形骸化を防ぐためにも経過措置の期限設定は必要年月日より、東京証券取引所の新市場区分がスタートする。 2022-03-29 10:53:08
金融 ニッセイ基礎研究所 雇用関連統計22年2月-まん延防止等重点措置の影響で、対面型サービス業の休業率がさらに上昇 https://www.nli-research.co.jp/topics_detail1/id=70682?site=nli 産業別には、製造業は前年差万人増月同万人増とヵ月連続で増加したが、まん延防止等重点措置の影響で、卸売・小売が前年差万人減月同万人減と減少幅が拡大したほか、生活関連サービス・娯楽が前年差万人減月同万人減とヵ月連続で減少した。 2022-03-29 10:01:47
金融 日本銀行:RSS 金融研究所ディスカッション・ペーパー・シリーズ(2022年収録分) http://www.boj.or.jp/research/imes/dps/dps22.htm Detail Nothing 2022-03-29 11:00:00
ニュース @日本経済新聞 電子版 高級車や宝石の輸出禁止 ロシアに追加制裁、4月5日から https://t.co/om4HgCVifS https://twitter.com/nikkei/statuses/1508624910997893120 輸出禁止 2022-03-29 01:59:42
ニュース @日本経済新聞 電子版 GM、「見切る」経営 販売台数4割減 アメ車からEVへ  https://t.co/jftpjzrs28 https://twitter.com/nikkei/statuses/1508624908624220161 販売 2022-03-29 01:59:41
ニュース @日本経済新聞 電子版 自分の泳ぎその場で確認 ソニーがコナミに映像システム https://t.co/8ES6YdavLq https://twitter.com/nikkei/statuses/1508622280967958529 自分 2022-03-29 01:49:15
ニュース @日本経済新聞 電子版 日清製粉グループ本社社長に滝原氏 https://t.co/a5hIzGxBWP https://twitter.com/nikkei/statuses/1508611306404081664 日清製粉グループ本社 2022-03-29 01:05:38
海外ニュース Japan Times latest articles Kishida tells ministers to craft economic package as prices skyrocket https://www.japantimes.co.jp/news/2022/03/29/business/economy-business/kishida-economic-package-april/ Kishida tells ministers to craft economic package as prices skyrocketCalls have grown within the ruling coalition for the government to take further steps to ease the pain increasingly felt by consumers with the yen s 2022-03-29 10:24:24
ニュース BBC News - Home Ukraine war: Odesa defies Russia and embraces signs of life https://www.bbc.co.uk/news/world-europe-60901032?at_medium=RSS&at_campaign=KARANGA forces 2022-03-29 01:03:40
北海道 北海道新聞 5G網、23年度人口95%に 総務省、整備目標を引き上げ https://www.hokkaido-np.co.jp/article/662478/ 光ファイバー 2022-03-29 10:34:00
北海道 北海道新聞 ロシア外相、インド訪問か ルーブル払い巡り https://www.hokkaido-np.co.jp/article/662476/ 首都 2022-03-29 10:32:00
北海道 北海道新聞 スミスさんの平手打ちで調査 米アカデミー、本人は謝罪 https://www.hokkaido-np.co.jp/article/662413/ 平手打ち 2022-03-29 10:09:48
北海道 北海道新聞 「太平洋抑止」に7550億円 中国警戒、米軍の優位支援 https://www.hokkaido-np.co.jp/article/662462/ 会計年度 2022-03-29 10:04:00
北海道 北海道新聞 東証、157円高 https://www.hokkaido-np.co.jp/article/662461/ 日経平均株価 2022-03-29 10:04:00
ビジネス 東洋経済オンライン ナダル「僕はいかにしてクズ芸人になったのか」 KOC優勝後の不振から学んだとても大切なこと | 読書 | 東洋経済オンライン https://toyokeizai.net/articles/-/540842?utm_source=rss&utm_medium=http&utm_campaign=link_back 大切なこと 2022-03-29 10:30:00
マーケティング MarkeZine サイバーエージェント、子会社「CA GameFi」を設立 ブロックチェーンゲーム事業の提供を図る http://markezine.jp/article/detail/38670 cagamefi 2022-03-29 10:15:00
マーケティング AdverTimes トピー工業、100周年プロジェクトの進め方 https://www.advertimes.com/20220329/article379884/ 取り組み 2022-03-29 01:30:10
マーケティング AdverTimes ANA、イノベーション推進部長に加藤氏 前ANA X社長 https://www.advertimes.com/20220329/article380143/ 部長 2022-03-29 01:21:49

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)