Skip to main content

Posts

React native app | event2/event-config.h file not found

  ERROR : event2/event-config.h file not found react native app Sol :  Just change use_flipper! to use_flipper!({ 'Flipper' => '0.80. 0' }) Then either in ios folder, run pod install again, or in your react native project root directory, run npx pod-install again URL : https://stackoverflow.com/questions/66019068/event2-event-config-h-file-not-found

Fencing ( Latitude Longitude )

 Check Lat/Long is Inside/Outside of fencing <?php function onLine($side,$point)  //check whether p is on the line or not {   if ($point['x'] <= max($side['x']['x'], $side['y']['x']) && $point['x'] <= min($side['x']['x'], $side['y']['x']) &&    ($point['y'] <= max($side['x']['y'], $side['y']['y']) && $point['y'] <= min($side['x']['y'], $side['y']['y'])))       return true; return false; } function direction($point1,$point2,$point3) {    $val=($point2['y']-$point1['y'])*($point3['x']-$point2['x'])-($point2['x']-$point1['x'])*($point3['y']-$point2['y']);    if ($val == 0)    return 0; //colinear    else if ($val <0)    return 2;          //anti-clockwise direction    return 1;          //clockwise direction } function...

REACT NATIVE ITERATE ROWS WITH DIFFERENT COLOURS

 mytrip.tsx import React from 'react' import { View, Text, TouchableOpacity, Image } from 'react-native' import { useNavigation } from '@react-navigation/native' import { ScrollView } from 'react-native-gesture-handler' import { SearchBar } from '../../components' import { styles } from './styles' import TripComponent from './TripComponent' const mytripScreen = () => {   const navigation = useNavigation()   const [trips, setTrips] = React.useState(MYTRIPS)   const searchTrips = (t: string) => {     const newData = MYTRIPS.filter(function (item) {       const itemData = item.title ? item.title.toUpperCase() : ''.toUpperCase()       const textData = t.toUpperCase()       return itemData.indexOf(textData) > -1     })     setTrips(newData)   }   return (     <View style={styles.mytripMainContainer}>       <View style={styles.mytripInnerContainer...

JS to show time slots ( PROGRESS TIMER )

  function format(time) {        // Hours, minutes and seconds     var hrs = ~~(time / 3600);     var mins = ~~((time % 3600) / 60);     var secs = ~~time % 60;     // Output like "1:01" or "4:03:59" or "123:03:59"     var ret = "";     if (hrs > 0) {         ret += "" + hrs + ":" + (mins < 10 ? "0" : "");     }     ret += "" + mins + ":" + (secs < 10 ? "0" : "");     ret += "" + secs;     return ret; } console.log(format(34322)); REF :  Labstack

Android emulator not able to access the internet

Change the DNS address of your network to 8.8.8.8 (Google's DNS) or another of your preference: MacOSX: Open "System Preferences" Click on "Network" Select the network which your computer is connected and click on "Advanced" Select "DNS", Select the "+" button, type "8.8.8.8" (Google's DNS) or if you prefer OpenDNS, "208.67.222.222" Select "Ok" and "Apply" Windows & Linux: https://developers.google.com/speed/public-dns/docs/using After that close the emulator and start it again. URL :  https://stackoverflow.com/questions/42736038/android-emulator-not-able-to-access-the-internet

REACT NATIVE DYNAMIC STAR RATING

  renderRatings ( rating ){     let stars = [];     // Loop 5 times     for (var i = 1; i <= 5; i++) {       // Set the path to filled stars       let path = <Icon name="star" style={{fontSize: 10, color: '#eb9534',marginHorizontal:2}}/>;       // If ratings is lower, set the path to unfilled stars       if (i > rating ) {         path = <Icon name="star" style={{fontSize: 10, color: theme.LIGHT_GREY_COLOR, marginHorizontal:2}}/>;       }       // Push the Image tag in the stars array       stars.push(path);     }     return (       <View style={{flexDirection:"row",marginTop: 5,}}>            { stars }       </View>     )   }     render () {   ...